]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man1/ldd.1
elf.5: SEE ALSO: add readelf(1)
[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.
ca93a9ed
MK
23.SS Security
24In the usual case,
25.B ldd
26invokes the standard dynamic linker (see
053439c9 27.BR ld.so (8))
ca93a9ed
MK
28with the
29.B LD_TRACE_LOADED_OBJECTS
30environment variable set to 1,
31which causes the linker to display the library dependencies.
32Be aware,
33however,
34that in some circumstances, some versions of
35.BR ldd
36may attempt to obtain the dependency information
37by directly executing the program.
38.\" Mainline glibc's ldd allows this possibility (the line
39.\" try_trace "$file"
40.\" in glibc 2.15, for example), but many distro versions of
41.\" ldd seem to remove that code path from the script.
42Thus, you should
43.I never
44employ
45.B ldd
46on an untrusted executable,
47since this may result in the execution of arbitrary code.
48A safer alternative when dealing with untrusted executables is:
49
72da9ef1 50 $ objdump \-p /path/to/program | grep NEEDED
fea681da
MK
51.SH OPTIONS
52.TP
9de38bff 53.B \-\-version
fea681da
MK
54Print the version number of
55.BR ldd .
56.TP
ed74a1a1 57.BR \-v ", " \-\-verbose
75b94dc3
MK
58Print all information, including, for example,
59symbol versioning information.
fea681da 60.TP
ed74a1a1 61.BR \-u ", " \-\-unused
46672d0d 62Print unused direct dependencies.
cd38a583 63(Since glibc 2.3.4.)
46672d0d 64.TP
ed74a1a1 65.BR \-d ", " \-\-data\-relocs
fea681da
MK
66Perform relocations and report any missing objects (ELF only).
67.TP
ed74a1a1 68.BR \-r ", " \-\-function\-relocs
fea681da
MK
69Perform relocations for both data objects and functions, and
70report any missing objects or functions (ELF only).
71.TP
72.B \-\-help
73Usage information.
2fb50e2a
MK
74.\" .SH NOTES
75.\" The standard version of
76.\" .B ldd
77.\" comes with glibc2.
78.\" Libc5 came with an older version, still present
79.\" on some systems.
80.\" The long options are not supported by the libc5 version.
81.\" On the other hand, the glibc2 version does not support
82.\" .B \-V
83.\" and only has the equivalent
84.\" .BR \-\-version .
85.\" .LP
86.\" The libc5 version of this program will use the name of a library given
87.\" on the command line as-is when it contains a \(aq/\(aq; otherwise it
88.\" searches for the library in the standard locations.
89.\" To run it
90.\" on a shared library in the current directory, prefix the name with "./".
fea681da
MK
91.SH BUGS
92.B ldd
93does not work on a.out shared libraries.
94.PP
95.B ldd
96does not work with some extremely old a.out programs which were
97built before
98.B ldd
99support was added to the compiler releases.
100If you use
101.B ldd
102on one of these programs, the program will attempt to run with
aeb9b6a6
MK
103.I argc
104= 0 and the results will be unpredictable.
fea681da
MK
105.\" .SH AUTHOR
106.\" David Engel.
107.\" Roland McGrath and Ulrich Drepper.
108.SH SEE ALSO
450c6969 109.BR pldd (1),
cd22e342 110.BR sprof (1),
fea681da
MK
111.BR ld.so (8),
112.BR ldconfig (8)