lddd
List dynamic library dependencies of executables
TLDR
Scan directories to find and list packages with broken library links that need to be rebuilt
SYNOPSIS
ldd [OPTION]... FILE...
PARAMETERS
--version
Print the program version.
-v
Print all information, including, for example, all version information from the dynamic section.
-d
Perform relocations and report any missing objects (only useful for debugging).
-r
Perform data relocations and report any missing objects or relocations (only useful for debugging).
-u
Print unused direct dependencies.
-L
Resolve any library argument as a load command. For each library, produce a path of where it was loaded from (as if the library was passed directly to ldd). This is only useful when specifying libraries on the command line.
-f FORMAT
Use the specified format for output. Can be 'dynamic-elf' (the default) or 'flat' (to simply list the direct dependencies).
--data-relocs
Process only data relocations
--all
Print all information.
--help
Display help information.
DESCRIPTION
ldd (list dynamic dependencies) prints the shared library dependencies required by each program or shared library specified on the command line.
It works by examining the program's ELF header and recursively tracing the dependencies. It shows the libraries the specified program needs to run and the addresses where they are loaded into memory. This information is vital for debugging, understanding program behavior, and ensuring compatibility across different systems. It's particularly useful when deploying software or troubleshooting runtime errors related to missing or incorrect libraries. Be aware that directly running ldd on untrusted executables can pose a security risk if the executable attempts malicious behavior during the dependency resolution process. Use with caution and on trusted binaries.
CAVEATS
Running ldd on untrusted executables can be dangerous. The executable is run (indirectly) during the dependency resolution process, potentially allowing malicious code to execute. ldd is not a shell script; it's typically a small C program that directly invokes the dynamic linker with the target program.
EXIT STATUS
ldd normally exits with a status of 0. If any errors occur, such as being unable to find a file or if any of the files aren't executable, then ldd exits with a nonzero status code.
SECURITY CONSIDERATIONS
As mentioned in the 'caveats' section, running ldd on untrusted executables can be a security risk. The dynamic linker executes parts of the target binary to resolve dependencies. Therefore, use caution and only execute ldd on binaries from trusted sources. Consider using alternative methods, such as static analysis tools, for examining dependencies of potentially malicious files.
HISTORY
ldd has been a standard tool in Unix-like systems for many years. Its development is intertwined with the evolution of dynamic linking. Initially, simpler versions existed, but the modern ldd is a core utility provided as part of the glibc package, evolving alongside the dynamic linker itself. It's crucial for understanding shared library dependencies that rose to prominence with the need for code reuse and reduced application sizes.