A secure, static-analysis-only alternative to ldd(1) for Linux that never loads or executes the target binary
On some Linux systems, ldd will try to load the binary through the linker to check what libraries are being loaded.
That means the library's constructor/destructor may be invoked which could be an issue for untrusted binaries (see "Security" section of man ldd.1)
The goal of sldd is to develop an alternative implementation of ldd which is known to always be safe to use on unknown binaries and which can also work across different CPU architectures
Note: Right now,
slddis beta quality software. If you find a Linux binary whichsldddoesn't work properly on please open an issue
cargo install --git https://github.com/Darazaki/slddAfter that, sldd should be in your $PATH
You can get this output by running sldd --help:
Usage: sldd [OPTIONS] <BINARY>
Arguments:
<BINARY> ELF binary or shared library to analyse
Options:
-v, --verbose Print raw ELF metadata (PT_INTERP, DT_RPATH, DT_RUNPATH, DT_NEEDED list) before the resolved dependency tree
-d, --direct-only Show only direct (depth-0) dependencies; skip transitive resolution
-L, --search-dir <DIR> Add a directory to the library search path (may be repeated)
--no-cache Do not consult /etc/ld.so.cache during resolution
--no-ld-path Do not honour LD_LIBRARY_PATH from the current environment
--porcelain Machine-readable output: one "name => /path" (or "NOT FOUND") per line
--limit-interp <SIZE> Maximum size of the PT_INTERP segment (default: 4K). Accepts unit suffixes: 512, 4K, 1M, 2G, etc [default: "4.0 KiB"]
--limit-dynamic <SIZE> Maximum size of the PT_DYNAMIC segment (default: 1M). Accepts unit suffixes: 512, 4K, 1M, 2G, etc [default: "1.0 MiB"]
--limit-strtab <SIZE> Maximum size of the dynamic string table (default: 32M). Accepts unit suffixes: 512, 4K, 1M, 2G, etc [default: "32.0 MiB"]
--limit-shdrs <SIZE> Maximum size of the section header table (default: 8M). Accepts unit suffixes: 512, 4K, 1M, 2G, etc [default: "8.0 MiB"]
--limit-needed <COUNT> Maximum number of DT_NEEDED entries (default: 1024) [default: 1024]
-h, --help Print help (see more with '--help')
-V, --version Print version
Exit codes: 0 => all resolved; 1 => missing libraries; 2 = parse error