]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man1/ldd.1
ldd.1: Add more detail on the output of ldd
[thirdparty/man-pages.git] / man1 / ldd.1
CommitLineData
fea681da
MK
1.\" Copyright 1995-2000 David Engel (david@ods.com)
2.\" Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)
3.\" Copyright 2000 Ben Collins (bcollins@debian.org)
4.\" Redone for GLibc 2.2
5.\" Copyright 2000 Jakub Jelinek (jakub@redhat.com)
6.\" Corrected.
7.\" Most of this was copied from the README file.
2297bf0e 8.\"
fd0fc519 9.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
558f3367 10.\" Do not restrict distribution.
fea681da 11.\" May be distributed under the GNU General Public License
fd0fc519 12.\" %%%LICENSE_END
4784c377 13.\"
460495ca 14.TH LDD 1 2015-08-08 "" "Linux Programmer's Manual"
fea681da 15.SH NAME
43151de3 16ldd \- print shared object dependencies
fea681da 17.SH SYNOPSIS
1b369cc6 18.BR ldd " [\fIoption\fP]... \fIfile\fP..."
fea681da
MK
19.SH DESCRIPTION
20.B ldd
30ea59e7 21prints the shared objects (shared libraries) required by each program or
43151de3 22shared object specified on the command line.
98ea8ea3
MK
23An example of its use and output is the following:
24
25.nf
26
27$ \fBldd /bin/ls\fP
28 linux-vdso.so.1 (0x00007ffcc3563000)
29 libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f87e5459000)
30 libcap.so.2 => /lib64/libcap.so.2 (0x00007f87e5254000)
31 libc.so.6 => /lib64/libc.so.6 (0x00007f87e4e92000)
32 libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f87e4c22000)
33 libdl.so.2 => /lib64/libdl.so.2 (0x00007f87e4a1e000)
34 /lib64/ld-linux-x86-64.so.2 (0x00005574bf12e000)
35 libattr.so.1 => /lib64/libattr.so.1 (0x00007f87e4817000)
36 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f87e45fa000)
37.fi
38
ca93a9ed
MK
39In the usual case,
40.B ldd
41invokes the standard dynamic linker (see
053439c9 42.BR ld.so (8))
ca93a9ed
MK
43with the
44.B LD_TRACE_LOADED_OBJECTS
98ea8ea3
MK
45environment variable set to 1.
46This causes the dynamic linker to inspect the program's dynamic dependencies,
47and find (according to the rules described in
48.BR ld.so (8))
49and load the objects that satisfy those dependencies.
50For each dependency,
51.BR ldd
52displays the location of the matching object
53and the (hexadecimal) address at which it is loaded.
54(The
55.I linux-vdso
56and
57.I ld-linux
58shared dependencies are special; see
59.BR vdso (7)
60and
61.BR ld.so (8).)
62.\"
63.SS Security
64Be aware that in some circumstances, some versions of
ca93a9ed
MK
65.BR ldd
66may attempt to obtain the dependency information
67by directly executing the program.
68.\" Mainline glibc's ldd allows this possibility (the line
69.\" try_trace "$file"
70.\" in glibc 2.15, for example), but many distro versions of
71.\" ldd seem to remove that code path from the script.
72Thus, you should
73.I never
74employ
75.B ldd
76on an untrusted executable,
77since this may result in the execution of arbitrary code.
78A safer alternative when dealing with untrusted executables is:
79
72da9ef1 80 $ objdump \-p /path/to/program | grep NEEDED
fea681da
MK
81.SH OPTIONS
82.TP
9de38bff 83.B \-\-version
fea681da
MK
84Print the version number of
85.BR ldd .
86.TP
ed74a1a1 87.BR \-v ", " \-\-verbose
75b94dc3
MK
88Print all information, including, for example,
89symbol versioning information.
fea681da 90.TP
ed74a1a1 91.BR \-u ", " \-\-unused
46672d0d 92Print unused direct dependencies.
cd38a583 93(Since glibc 2.3.4.)
46672d0d 94.TP
ed74a1a1 95.BR \-d ", " \-\-data\-relocs
fea681da
MK
96Perform relocations and report any missing objects (ELF only).
97.TP
ed74a1a1 98.BR \-r ", " \-\-function\-relocs
fea681da
MK
99Perform relocations for both data objects and functions, and
100report any missing objects or functions (ELF only).
101.TP
102.B \-\-help
103Usage information.
2fb50e2a
MK
104.\" .SH NOTES
105.\" The standard version of
106.\" .B ldd
107.\" comes with glibc2.
108.\" Libc5 came with an older version, still present
109.\" on some systems.
110.\" The long options are not supported by the libc5 version.
111.\" On the other hand, the glibc2 version does not support
112.\" .B \-V
113.\" and only has the equivalent
114.\" .BR \-\-version .
115.\" .LP
116.\" The libc5 version of this program will use the name of a library given
117.\" on the command line as-is when it contains a \(aq/\(aq; otherwise it
118.\" searches for the library in the standard locations.
119.\" To run it
120.\" on a shared library in the current directory, prefix the name with "./".
fea681da
MK
121.SH BUGS
122.B ldd
123does not work on a.out shared libraries.
124.PP
125.B ldd
126does not work with some extremely old a.out programs which were
127built before
128.B ldd
129support was added to the compiler releases.
130If you use
131.B ldd
132on one of these programs, the program will attempt to run with
aeb9b6a6
MK
133.I argc
134= 0 and the results will be unpredictable.
fea681da
MK
135.\" .SH AUTHOR
136.\" David Engel.
137.\" Roland McGrath and Ulrich Drepper.
138.SH SEE ALSO
450c6969 139.BR pldd (1),
cd22e342 140.BR sprof (1),
fea681da
MK
141.BR ld.so (8),
142.BR ldconfig (8)