]>
Commit | Line | Data |
---|---|---|
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. | |
8 | .\" Do not restrict distribution. | |
9 | .\" May be distributed under the GNU General Public License | |
ca93a9ed | 10 | .TH LDD 1 2012-07-16 "" "Linux Programmer's Manual" |
fea681da MK |
11 | .SH NAME |
12 | ldd \- print shared library dependencies | |
13 | .SH SYNOPSIS | |
d6d1a7c0 | 14 | .BR ldd " [OPTION]... FILE..." |
fea681da MK |
15 | .SH DESCRIPTION |
16 | .B ldd | |
17 | prints the shared libraries required by each program or shared library | |
18 | specified on the command line. | |
ca93a9ed MK |
19 | .SS Security |
20 | In the usual case, | |
21 | .B ldd | |
22 | invokes the standard dynamic linker (see | |
23 | .BR ld.so(8)) | |
24 | with the | |
25 | .B LD_TRACE_LOADED_OBJECTS | |
26 | environment variable set to 1, | |
27 | which causes the linker to display the library dependencies. | |
28 | Be aware, | |
29 | however, | |
30 | that in some circumstances, some versions of | |
31 | .BR ldd | |
32 | may attempt to obtain the dependency information | |
33 | by directly executing the program. | |
34 | .\" Mainline glibc's ldd allows this possibility (the line | |
35 | .\" try_trace "$file" | |
36 | .\" in glibc 2.15, for example), but many distro versions of | |
37 | .\" ldd seem to remove that code path from the script. | |
38 | Thus, you should | |
39 | .I never | |
40 | employ | |
41 | .B ldd | |
42 | on an untrusted executable, | |
43 | since this may result in the execution of arbitrary code. | |
44 | A safer alternative when dealing with untrusted executables is: | |
45 | ||
72da9ef1 | 46 | $ objdump \-p /path/to/program | grep NEEDED |
fea681da MK |
47 | .SH OPTIONS |
48 | .TP | |
9de38bff | 49 | .B \-\-version |
fea681da MK |
50 | Print the version number of |
51 | .BR ldd . | |
52 | .TP | |
53 | .B \-v\ \-\-verbose | |
75b94dc3 MK |
54 | Print all information, including, for example, |
55 | symbol versioning information. | |
fea681da | 56 | .TP |
46672d0d MK |
57 | .B \-u\ \-\-unused |
58 | Print unused direct dependencies. | |
cd38a583 | 59 | (Since glibc 2.3.4.) |
46672d0d | 60 | .TP |
fea681da MK |
61 | .B \-d\ \-\-data\-relocs |
62 | Perform relocations and report any missing objects (ELF only). | |
63 | .TP | |
64 | .B \-r\ \-\-function\-relocs | |
65 | Perform relocations for both data objects and functions, and | |
66 | report any missing objects or functions (ELF only). | |
67 | .TP | |
68 | .B \-\-help | |
69 | Usage information. | |
70 | .SH NOTES | |
71 | The standard version of | |
72 | .B ldd | |
677f4766 MK |
73 | comes with glibc2. |
74 | Libc5 came with an older version, still present | |
ca7b3c18 MK |
75 | on some systems. |
76 | The long options are not supported by the libc5 version. | |
fea681da MK |
77 | On the other hand, the glibc2 version does not support |
78 | .B \-V | |
79 | and only has the equivalent | |
80 | .BR \-\-version . | |
81 | .LP | |
82 | The libc5 version of this program will use the name of a library given | |
f81fb444 | 83 | on the command line as-is when it contains a \(aq/\(aq; otherwise it |
ca7b3c18 MK |
84 | searches for the library in the standard locations. |
85 | To run it | |
fea681da MK |
86 | on a shared library in the current directory, prefix the name with "./". |
87 | .SH BUGS | |
88 | .B ldd | |
89 | does not work on a.out shared libraries. | |
90 | .PP | |
91 | .B ldd | |
92 | does not work with some extremely old a.out programs which were | |
93 | built before | |
94 | .B ldd | |
95 | support was added to the compiler releases. | |
96 | If you use | |
97 | .B ldd | |
98 | on one of these programs, the program will attempt to run with | |
99 | \fIargc\fP = 0 and the results will be unpredictable. | |
100 | .\" .SH AUTHOR | |
101 | .\" David Engel. | |
102 | .\" Roland McGrath and Ulrich Drepper. | |
103 | .SH SEE ALSO | |
104 | .BR ld.so (8), | |
105 | .BR ldconfig (8) |