]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man8/ld.so.8
Import of man-pages 1.70
[thirdparty/man-pages.git] / man8 / ld.so.8
CommitLineData
fea681da
MK
1.\" This is in the public domain
2.TH LD.SO 8 2001-12-16 "" "Linux Programmer's Manual"
3.SH NAME
4ld.so, ld-linux.so* \- dynamic linker/loader
5.SH DESCRIPTION
6The programs
7.B ld.so
8and
9.B ld-linux.so*
10find and load the shared libraries needed by a program, prepare
11the program to run, and then run it.
12.LP
13Linux binaries require dynamic linking (linking at run time)
14unless the
15.B \-static
16option was given to
17.B ld
18during compilation.
19.LP
20The program
21.B ld.so
22handles a.out binaries, a format used long ago;
23.B ld-linux.so*
24handles ELF (\fB/lib/ld-linux.so.1\fP for libc5, \fB/lib/ld-linux.so.2\fP
25for glibc2), which everybody has been using for years now.
26Otherwise both have the same behaviour, and use the same
27support files and programs
28.BR ldd (1),
29.BR ldconfig (8)
30and
31.IR /etc/ld.so.conf .
32.LP
33The shared libraries needed by the program are searched for
34in various places:
35.IP o
36(ELF only) Using the DT_RPATH dynamic section attribute
37of the binary if present and DT_RUNPATH attribute does not exist.
38Use of DT_RPATH is deprecated.
39.IP o
40Using the environment variable
41.BR LD_LIBRARY_PATH .
42Except if the executable is a setuid/setgid binary, in which case it
43is ignored.
44.IP o
45(ELF only) Using the DT_RUNPATH dynamic section attribute
46of the binary if present.
47.IP o
48From the cache file
49.BR /etc/ld.so.cache
50which contains a compiled list of candidate libraries previously found
51in the augmented library path. If, however, the binary was linked with
52.B -z nodeflib
53linker option, libraries in the default library paths are skipped.
54.IP o
55In the default path
56.BR /lib ,
57and then
58.BR /usr/lib .
59If the binary was linked with
60.B -z nodeflib
61linker option, this step is skipped.
62.SH SYNOPSIS
63The dynamic linker can be run either indirectly through running some
64dynamically linked program or library (in which case no command line options
65to the dynamic linker can be passed and, in the ELF case, the dynamic linker
66which is stored in the
67.B .interp
68section of the program is executed) or directly by running:
69.P
70.B /lib/ld-linux.so.*
71[OPTIONS] [PROGRAM [ARGUMENTS]]
72.SH COMMAND LINE OPTIONS
73.TP
74.B --list
75List all dependencies and how they are resolved.
76.TP
77.B --verify
78Verify that program is dynamically linked and this dynamic linker can handle
79it.
80.TP
81.B --library-path PATH
82Override
83.B LD_LIBRARY_PATH
84environment variable setting (see below).
85.TP
86.B --ignore-rpath LIST
87Ignore RPATH and RUNPATH information in object names in LIST.
88This option has been supported by glibc2 for about one hour.
89Then it was renamed into:
90.TP
91.B --inhibit-rpath LIST
92.SH ENVIRONMENT
93There are four important environment variables.
94.TP
95.B LD_LIBRARY_PATH
96A colon-separated list of directories in which to search for
97ELF libraries at execution-time.
98Similar to the
99.B PATH
100environment variable.
101.TP
102.B LD_PRELOAD
103A whitespace-separated list of additional, user-specified, ELF shared
104libraries to be loaded before all others.
105This can be used to selectively override functions in other shared libraries.
106For setuid/setgid ELF binaries, only libraries in the standard search
107directories that are also setuid will be loaded.
108.TP
109.B LD_BIND_NOW
110(libc5; glibc since 2.1.1)
111If set to non-empty string, causes the dynamic linker to resolve all symbols
112at program startup instead of deferring function call resolval to the point
113when they are first referenced.
114This is useful when using a debugger.
115.TP
116.B LD_TRACE_LOADED_OBJECTS
117(ELF only)
118If set to non-empty string, causes the program to list its dynamic library
119dependencies, as if run by
120.BR ldd (1),
121instead of running normally.
122.LP
123Then there are lots of more or less obscure variables,
124many obsolete or only for internal use.
125.TP
126.B LD_WARN
127(ELF only)(glibc since 2.1.3)
128If set to non-empty string, warn about unresolved symbols.
129.TP
130.B LD_NOWARN
131(a.out only)(libc5)
132Suppress warnings about a.out libraries with incompatible minor
133version numbers.
134.TP
135.B LD_BIND_NOT
136(glibc since 2.1.95)
137Do not update the GOT (global offset table) and PLT (procedure linkage table)
138after resolving a symbol.
139.TP
140.B LD_DEBUG
141(glibc since 2.1)
142Output verbose debugging information about the dynamic linker.
143If set to
144.B all
145prints all debugging information it has, if set to
146.B help
147prints a help message about which categories can be specified in this
148environment variable.
149.TP
150.B LD_DEBUG_OUTPUT
151(glibc since 2.1)
152File where
153.B LD_DEBUG
154output should be fed into, default is standard output.
155LD_DEBUG_OUTPUT is ignored for setuid/setgid binaries.
156.TP
157.B LD_VERBOSE
158(glibc since 2.1)
159If set to non-empty string, output symbol versioning information about the
160program if querying information about the program (ie. either
161.B LD_TRACE_LOADED_OBJECTS
162has been set, or
163.B --list
164or
165.B --verify
166options have been given to the dynamic linker).
167.TP
168.B LD_PROFILE
169(glibc since 2.1)
170Shared object to be profiled.
171.TP
172.B LD_PROFILE_OUTPUT
173(glibc since 2.1)
174File where
175.B LD_PROFILE
176output should be stored, default is standard output.
177LD_DEBUG_OUTPUT is ignored for setuid/setgid binaries.
178.TP
179.B LD_AOUT_LIBRARY_PATH
180(libc5)
181Version of LD_LIBRARY_PATH for a.out binaries only.
182Old versions of ld-linux.so.1 also supported LD_ELF_LIBRARY_PATH.
183.TP
184.B LD_AOUT_PRELOAD
185(libc5)
186Version of LD_PRELOAD for a.out binaries only.
187Old versions of ld-linux.so.1 also supported LD_ELF_PRELOAD.
188.TP
189.B LD_SHOW_AUXV
190(glibc since 2.1)
191Show auxiliary array passed up from the kernel.
192.TP
193.B LD_HWCAP_MASK
194(glibc since 2.1)
195Mask for hardware capabilities.
196.TP
197.B LD_ORIGIN_PATH
198(glibc since 2.1)
199Path where the binary is found (for non-setuid programs).
200.TP
201.B LD_DYNAMIC_WEAK
202(glibc since 2.1.91)
203Allow weak symbols to be overridden (reverting to old glibc behaviour).
204.TP
205.B LD_KEEPDIR
206(a.out only)(libc5)
207Don't ignore the directory in the names of a.out libraries to be loaded.
208Use of this option is strongly discouraged.
209.TP
210.B LDD_ARGV0
211(libc5)
212.IR argv [0]
213to be used by
214.BR ldd (1)
215when none is present.
216.SH FILES
217.PD 0
218.TP
219.B /lib/ld.so
220a.out dynamic linker/loader
221.TP
222.BR /lib/ld-linux.so. { 1 , 2 }
223ELF dynamic linker/loader
224.TP
225.B /etc/ld.so.cache
226File containing a compiled list of directories in which to search for
227libraries and an ordered list of candidate libraries.
228.TP
229.B /etc/ld.so.preload
230File containing a whitespace separated list of ELF shared libraries to
231be loaded before the program.
232libraries and an ordered list of candidate libraries.
233.TP
234.B lib*.so*
235shared libraries
236.PD
237.SH NOTES
238The
239.B ld.so
240functionality is available for executables compiled using libc version
2414.4.3 or greater.
242ELF functionality is available since Linux 1.1.52 and libc5.
243.SH SEE ALSO
244.BR ldd (1),
245.BR ldconfig (8)
246.\" .SH AUTHORS
247.\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus
248.\" Torvalds, Lars Wirzenius and Mitch D'Souza
249.\" ld-linux.so: Roland McGrath, Ulrich Drepper and others.
250.\"
251.\" In the above, (libc5) stands for David Engel's ld.so/ld-linux.so.