ldd (''List Dynamic Dependencies'') is a
*nix utility that prints the
shared libraries
In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and su ...
required by each program or shared library specified on the command line. It was developed by
Roland McGrath and
Ulrich Drepper Ulrich (), is a German given name, derived from Old High German ''Uodalrich'', ''Odalric''. It is composed of the elements '' uodal-'' meaning "(noble) heritage" and ''-rich'' meaning "rich, powerful". Attested from the 8th century as the name of Al ...
. If some shared library is missing for any program, that program won't come up.
Security
ldd is a
shell script
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manip ...
that executes the program given as argument, and shouldn't be used with untrusted binaries. The ldd manual page suggests to use the following command using the
objdump
objdump is a command-line program for displaying various information about object files on Unix-like operating systems. For instance, it can be used as a disassembler to view an executable in assembly form. It is part of the GNU Binutils for fine- ...
and
grep
grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. Its name comes from the ed command ''g/re/p'' (''globally search for a regular expression and print matching lines''), which has the sa ...
utilities as alternative:
user@home ~/ $ objdump -p /path/program , grep NEEDED
Usage examples
user@home ~/ $ ldd /usr/bin/mp3blaster
linux-vdso.so.1 => (0x00007fff8fdff000)
libsidplay.so.1 => /usr/lib/libsidplay.so.1 (0x00007f4ea98ec000)
libvorbisfile.so.3 => /usr/lib/libvorbisfile.so.3 (0x00007f4ea96e4000)
libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x00007f4ea94b6000)
libncurses.so.5 => /lib/libncurses.so.5 (0x00007f4ea9273000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f4ea9056000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f4ea8d41000)
libm.so.6 => /lib/libm.so.6 (0x00007f4ea8abe000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f4ea88a7000)
libc.so.6 => /lib/libc.so.6 (0x00007f4ea8523000)
libogg.so.0 => /usr/lib/libogg.so.0 (0x00007f4ea831c000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f4ea8118000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4ea9b59000)
user@home ~/ $ ldd /usr/lib/i386-linux-gnu/libstdc++.so.6.0.20
linux-gate.so.1 (0xb7733000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb75da000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb742f000)
/lib/ld-linux.so.2 (0xb7734000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7411000)
References
Unix software
{{Unix-stub
Unix programming tools