OSDN Git Service

3fd3ccbb8f4122f82b68f1c179f56215904632d5
[linuxjm/LDP_man-pages.git] / original / man1 / ldd.1
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 .\"
9 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
10 .\" Do not restrict distribution.
11 .\" May be distributed under the GNU General Public License
12 .\" %%%LICENSE_END
13 .\"
14 .TH LDD 1 2012-07-16 "" "Linux Programmer's Manual"
15 .SH NAME
16 ldd \- print shared library dependencies
17 .SH SYNOPSIS
18 .BR ldd " [OPTION]... FILE..."
19 .SH DESCRIPTION
20 .B ldd
21 prints the shared libraries required by each program or shared library
22 specified on the command line.
23 .SS Security
24 In the usual case,
25 .B ldd
26 invokes the standard dynamic linker (see
27 .BR ld.so (8))
28 with the
29 .B LD_TRACE_LOADED_OBJECTS
30 environment variable set to 1,
31 which causes the linker to display the library dependencies.
32 Be aware,
33 however,
34 that in some circumstances, some versions of
35 .BR ldd
36 may attempt to obtain the dependency information
37 by 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.
42 Thus, you should
43 .I never
44 employ
45 .B ldd
46 on an untrusted executable,
47 since this may result in the execution of arbitrary code.
48 A safer alternative when dealing with untrusted executables is:
49
50     $ objdump \-p /path/to/program | grep NEEDED
51 .SH OPTIONS
52 .TP
53 .B \-\-version
54 Print the version number of
55 .BR ldd .
56 .TP
57 .B \-v\ \-\-verbose
58 Print all information, including, for example,
59 symbol versioning information.
60 .TP
61 .B \-u\ \-\-unused
62 Print unused direct dependencies.
63 (Since glibc 2.3.4.)
64 .TP
65 .B \-d\ \-\-data\-relocs
66 Perform relocations and report any missing objects (ELF only).
67 .TP
68 .B \-r\ \-\-function\-relocs
69 Perform relocations for both data objects and functions, and
70 report any missing objects or functions (ELF only).
71 .TP
72 .B \-\-help
73 Usage information.
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 "./".
91 .SH BUGS
92 .B ldd
93 does not work on a.out shared libraries.
94 .PP
95 .B ldd
96 does not work with some extremely old a.out programs which were
97 built before
98 .B ldd
99 support was added to the compiler releases.
100 If you use
101 .B ldd
102 on one of these programs, the program will attempt to run with
103 .I argc
104 = 0 and the results will be unpredictable.
105 .\" .SH AUTHOR
106 .\" David Engel.
107 .\" Roland McGrath and Ulrich Drepper.
108 .SH SEE ALSO
109 .BR ld.so (8),
110 .BR ldconfig (8)
111 .SH COLOPHON
112 This page is part of release 3.67 of the Linux
113 .I man-pages
114 project.
115 A description of the project,
116 information about reporting bugs,
117 and the latest version of this page,
118 can be found at
119 \%http://www.kernel.org/doc/man\-pages/.