1LDD(1) Linux Programmer's Manual LDD(1)
2
3
4
6 ldd - print shared object dependencies
7
9 ldd [option]... file...
10
12 ldd prints the shared objects (shared libraries) required by each pro‐
13 gram or shared object specified on the command line. An example of its
14 use and output (using sed(1) to trim leading white space for readabil‐
15 ity in this page) is the following:
16
17 $ ldd /bin/ls | sed 's/^ */ /'
18 linux-vdso.so.1 (0x00007ffcc3563000)
19 libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f87e5459000)
20 libcap.so.2 => /lib64/libcap.so.2 (0x00007f87e5254000)
21 libc.so.6 => /lib64/libc.so.6 (0x00007f87e4e92000)
22 libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f87e4c22000)
23 libdl.so.2 => /lib64/libdl.so.2 (0x00007f87e4a1e000)
24 /lib64/ld-linux-x86-64.so.2 (0x00005574bf12e000)
25 libattr.so.1 => /lib64/libattr.so.1 (0x00007f87e4817000)
26 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f87e45fa000)
27
28 In the usual case, ldd invokes the standard dynamic linker (see
29 ld.so(8)) with the LD_TRACE_LOADED_OBJECTS environment variable set to
30 1. This causes the dynamic linker to inspect the program's dynamic de‐
31 pendencies, and find (according to the rules described in ld.so(8)) and
32 load the objects that satisfy those dependencies. For each dependency,
33 ldd displays the location of the matching object and the (hexadecimal)
34 address at which it is loaded. (The linux-vdso and ld-linux shared de‐
35 pendencies are special; see vdso(7) and ld.so(8).)
36
37 Security
38 Be aware that in some circumstances (e.g., where the program specifies
39 an ELF interpreter other than ld-linux.so), some versions of ldd may
40 attempt to obtain the dependency information by attempting to directly
41 execute the program, which may lead to the execution of whatever code
42 is defined in the program's ELF interpreter, and perhaps to execution
43 of the program itself. (In glibc versions before 2.27, the upstream
44 ldd implementation did this for example, although most distributions
45 provided a modified version that did not.)
46
47 Thus, you should never employ ldd on an untrusted executable, since
48 this may result in the execution of arbitrary code. A safer alterna‐
49 tive when dealing with untrusted executables is:
50
51 $ objdump -p /path/to/program | grep NEEDED
52
53 Note, however, that this alternative shows only the direct dependencies
54 of the executable, while ldd shows the entire dependency tree of the
55 executable.
56
58 --version
59 Print the version number of ldd.
60
61 -v, --verbose
62 Print all information, including, for example, symbol versioning
63 information.
64
65 -u, --unused
66 Print unused direct dependencies. (Since glibc 2.3.4.)
67
68 -d, --data-relocs
69 Perform relocations and report any missing objects (ELF only).
70
71 -r, --function-relocs
72 Perform relocations for both data objects and functions, and re‐
73 port any missing objects or functions (ELF only).
74
75 --help Usage information.
76
78 ldd does not work on a.out shared libraries.
79
80 ldd does not work with some extremely old a.out programs which were
81 built before ldd support was added to the compiler releases. If you
82 use ldd on one of these programs, the program will attempt to run with
83 argc = 0 and the results will be unpredictable.
84
86 pldd(1), sprof(1), ld.so(8), ldconfig(8)
87
89 This page is part of release 5.10 of the Linux man-pages project. A
90 description of the project, information about reporting bugs, and the
91 latest version of this page, can be found at
92 https://www.kernel.org/doc/man-pages/.
93
94
95
96 2019-03-06 LDD(1)