OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man1 / ldd.1
index 5646b9c..406089f 100644 (file)
@@ -5,9 +5,13 @@
 .\" Copyright 2000 Jakub Jelinek (jakub@redhat.com)
 .\"    Corrected.
 .\" Most of this was copied from the README file.
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
 .\" Do not restrict distribution.
 .\" May be distributed under the GNU General Public License
-.TH LDD 1 2000-10-30 "" "Linux Programmer's Manual"
+.\" %%%LICENSE_END
+.\"
+.TH LDD 1 2012-07-16 "" "Linux Programmer's Manual"
 .SH NAME
 ldd \- print shared library dependencies
 .SH SYNOPSIS
@@ -16,6 +20,34 @@ ldd \- print shared library dependencies
 .B ldd
 prints the shared libraries required by each program or shared library
 specified on the command line.
+.SS Security
+In the usual case,
+.B ldd
+invokes the standard dynamic linker (see
+.BR ld.so (8))
+with the
+.B LD_TRACE_LOADED_OBJECTS
+environment variable set to 1,
+which causes the linker to display the library dependencies.
+Be aware,
+however,
+that in some circumstances, some versions of
+.BR ldd
+may attempt to obtain the dependency information
+by directly executing the program.
+.\" Mainline glibc's ldd allows this possibility (the line
+.\"      try_trace "$file"
+.\" in glibc 2.15, for example), but many distro versions of
+.\" ldd seem to remove that code path from the script.
+Thus, you should
+.I never
+employ
+.B ldd
+on an untrusted executable,
+since this may result in the execution of arbitrary code.
+A safer alternative when dealing with untrusted executables is:
+
+    $ objdump \-p /path/to/program | grep NEEDED
 .SH OPTIONS
 .TP
 .B \-\-version
@@ -68,10 +100,20 @@ support was added to the compiler releases.
 If you use
 .B ldd
 on one of these programs, the program will attempt to run with
-\fIargc\fP = 0 and the results will be unpredictable.
+.I argc
+= 0 and the results will be unpredictable.
 .\" .SH AUTHOR
 .\" David Engel.
 .\" Roland McGrath and Ulrich Drepper.
 .SH SEE ALSO
 .BR ld.so (8),
 .BR ldconfig (8)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.