]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man8/ld.so.8
clone.2: ffix
[thirdparty/man-pages.git] / man8 / ld.so.8
CommitLineData
2d6c6dd1 1.\" %%%LICENSE_START(PUBLIC_DOMAIN)
fea681da 2.\" This is in the public domain
2d6c6dd1 3.\" %%%LICENSE_END
6a717e5e 4.\"
734882f4 5.TH LD.SO 8 2017-05-03 "GNU" "Linux Programmer's Manual"
fea681da 6.SH NAME
d74d5bd3 7ld.so, ld\-linux.so \- dynamic linker/loader
a1d5f77c 8.SH SYNOPSIS
cd6dddf6 9The dynamic linker can be run either indirectly by running some
43151de3
MK
10dynamically linked program or shared object
11(in which case no command-line options
a1d5f77c
MK
12to the dynamic linker can be passed and, in the ELF case, the dynamic linker
13which is stored in the
14.B .interp
15section of the program is executed) or directly by running:
11ac5b51 16.PP
d74d5bd3 17.I /lib/ld\-linux.so.*
a1d5f77c 18[OPTIONS] [PROGRAM [ARGUMENTS]]
fea681da
MK
19.SH DESCRIPTION
20The programs
21.B ld.so
22and
d74d5bd3 23.B ld\-linux.so*
43151de3
MK
24find and load the shared objects (shared libraries) needed by a program,
25prepare the program to run, and then run it.
dd3568a1 26.PP
fea681da
MK
27Linux binaries require dynamic linking (linking at run time)
28unless the
29.B \-static
30option was given to
f19a0f03 31.BR ld (1)
fea681da 32during compilation.
dd3568a1 33.PP
fea681da
MK
34The program
35.B ld.so
36handles a.out binaries, a format used long ago;
d74d5bd3
MK
37.B ld\-linux.so*
38(\fI/lib/ld\-linux.so.1\fP for libc5, \fI/lib/ld\-linux.so.2\fP for glibc2)
d8d00ab7
MK
39handles ELF,
40which everybody has been using for years now.
2b9b829d 41Otherwise, both have the same behavior, and use the same
fea681da
MK
42support files and programs
43.BR ldd (1),
9af134cd 44.BR ldconfig (8),
fea681da
MK
45and
46.IR /etc/ld.so.conf .
dd3568a1 47.PP
43151de3 48When resolving shared object dependencies,
15d116d5
MK
49the dynamic linker first inspects each dependency
50string to see if it contains a slash (this can occur if
43151de3 51a shared object pathname containing slashes was specified at link time).
15d116d5
MK
52If a slash is found, then the dependency string is interpreted as
53a (relative or absolute) pathname,
43151de3 54and the shared object is loaded using that pathname.
dd3568a1 55.PP
43151de3 56If a shared object dependency does not contain a slash,
15d116d5 57then it is searched for in the following order:
cd6dddf6 58.IP o 3
dc4b358f 59Using the directories specified in the
cd6dddf6 60DT_RPATH dynamic section attribute
fea681da
MK
61of the binary if present and DT_RUNPATH attribute does not exist.
62Use of DT_RPATH is deprecated.
63.IP o
64Using the environment variable
24fb0923
MK
65.BR LD_LIBRARY_PATH
66(unless the executable is being run in secure-execution mode; see below).
880f5b4b 67in which case it is ignored.
fea681da 68.IP o
dc4b358f 69Using the directories specified in the
cd6dddf6 70DT_RUNPATH dynamic section attribute
25d4adc2
MK
71of the binary if present.
72Such directories are searched only to
bbba55c2 73find those objects required by DT_NEEDED (direct dependencies) entries
25d4adc2
MK
74and do not apply to those objects' children,
75which must themselves have their own DT_RUNPATH entries.
76This is unlike DT_RPATH, which is applied
bbba55c2 77to searches for all children in the dependency tree.
fea681da
MK
78.IP o
79From the cache file
de6d7600 80.IR /etc/ld.so.cache ,
43151de3 81which contains a compiled list of candidate shared objects previously found
c13182ef 82in the augmented library path.
cd6dddf6 83If, however, the binary was linked with the
4d9b6984 84.B \-z nodeflib
43151de3
MK
85linker option, shared objects in the default paths are skipped.
86Shared objects installed in hardware capability directories (see below)
87are preferred to other shared objects.
fea681da
MK
88.IP o
89In the default path
8478ee02 90.IR /lib ,
fea681da 91and then
8478ee02 92.IR /usr/lib .
39a15561 93(On some 64-bit architectures, the default paths for 64-bit shared objects are
b9359c7a
MK
94.IR /lib64 ,
95and then
96.IR /usr/lib64 .)
cd6dddf6 97If the binary was linked with the
4d9b6984 98.B \-z nodeflib
fea681da 99linker option, this step is skipped.
eeb25d47 100.SS Rpath token expansion
0a216931 101.PP
e01dc26a 102The dynamic linker
99194a09
MK
103understands certain token strings in an rpath specification
104(DT_RPATH or DT_RUNPATH).
105Those strings are substituted as follows:
eeb25d47
MK
106.TP
107.IR $ORIGIN " (or equivalently " ${ORIGIN} )
8a94e783 108This expands to
43151de3 109the directory containing the program or shared object.
0a216931
MK
110Thus, an application located in
111.I somedir/app
112could be compiled with
2a86152e 113.IP
5c977011 114 gcc \-Wl,\-rpath,\(aq$ORIGIN/../lib\(aq
2a86152e 115.IP
43151de3 116so that it finds an associated shared object in
0a216931 117.I somedir/lib
988db661
MK
118no matter where
119.I somedir
0a216931
MK
120is located in the directory hierarchy.
121This facilitates the creation of "turn-key" applications that
122do not need to be installed into special directories,
123but can instead be unpacked into any directory
43151de3 124and still find their own shared objects.
909df276
MK
125.TP
126.IR $LIB " (or equivalently " ${LIB} )
127This expands to
128.I lib
129or
130.I lib64
131depending on the architecture
132(e.g., on x86-64, it expands to
133.IR lib64
134and
135on x86-32, it expands to
136.IR lib ).
3f2f2461
MK
137.TP
138.IR $PLATFORM " (or equivalently " ${PLATFORM} )
139This expands to a string corresponding to the processor type
140of the host system (e.g., "x86_64").
141On some architectures, the Linux kernel doesn't provide a platform
142string to the dynamic linker.
143The value of this string is taken from the
144.BR AT_PLATFORM
145value in the auxiliary vector (see
146.BR getauxval (3)).
147.\" To get an idea of the places that $PLATFORM would match,
148.\" look at the output of the following:
0a216931 149.\"
3f2f2461
MK
150.\" mkdir /tmp/d
151.\" LD_LIBRARY_PATH=/tmp/d strace -e open /bin/date 2>&1 | grep /tmp/d
0a216931
MK
152.\"
153.\" ld.so lets names be abbreviated, so $O will work for $ORIGIN;
154.\" Don't do this!!
9d4869b3 155.SH OPTIONS
fea681da 156.TP
4d9b6984 157.B \-\-list
fea681da
MK
158List all dependencies and how they are resolved.
159.TP
4d9b6984 160.B \-\-verify
fea681da
MK
161Verify that program is dynamically linked and this dynamic linker can handle
162it.
163.TP
d74d5bd3 164.B \-\-inhibit\-cache
8584e381
MK
165Do not use
166.IR /etc/ld.so.cache .
495dadb7 167.TP
a831ad17
MK
168.BI \-\-library\-path " path"
169Use
170.I path
171instead of
fea681da
MK
172.B LD_LIBRARY_PATH
173environment variable setting (see below).
0a8909c4
MK
174The names
175.IR ORIGIN ,
176.IR LIB ,
177and
178.IR PLATFORM
179are interpreted as for the
180.BR LD_LIBRARY_PATH
181environment variable.
fea681da 182.TP
a831ad17
MK
183.BI \-\-inhibit\-rpath " list"
184Ignore RPATH and RUNPATH information in object names in
185.IR list .
6e1064d3 186This option is ignored when running in secure-execution mode (see below).
608dce1f 187.TP
a831ad17
MK
188.BI \-\-audit " list"
189Use objects named in
190.I list
191as auditors.
fea681da 192.SH ENVIRONMENT
6e1064d3 193Various environment variables influence the operation of the dynamic linker.
9894eac3
MK
194.\"
195.SS Secure-execution mode
196For security reasons,
197the effects of some environment variables are voided or modified if
198the dynamic linker determines that the binary should be
199run in secure-execution mode.
59e6b4c6
MK
200(For details, see the discussion of individual environment variables below.)
201A binary is executed in secure-execution mode if the
9894eac3
MK
202.B AT_SECURE
203entry in the auxiliary vector (see
204.BR getauxval (3))
205has a nonzero value.
206This entry may have a nonzero value for various reasons, including:
207.IP * 3
208The process's real and effective user IDs differ,
209or the real and effective group IDs differ.
c93f2202 210This typically occurs as a result of executing
9894eac3
MK
211a set-user-ID or set-group-ID program.
212.IP *
213A process with a non-root user ID executed a binary that
214conferred permitted or effective capabilities.
215.IP *
216A nonzero value may have been set by a Linux Security Module.
217.\"
218.SS Environment variables
6f6a4840 219Among the more important environment variables are the following:
fea681da 220.TP
9a741b5b 221.BR LD_ASSUME_KERNEL " (since glibc 2.2.3)"
43151de3 222Each shared object can inform the dynamic linker of the minimum kernel ABI
eeb25d47 223version that it requires.
ef74d4ad
MK
224(This requirement is encoded in an ELF note section that is viewable via
225.IR "readelf\ \-n"
226as a section labeled
227.BR NT_GNU_ABI_TAG .)
eeb25d47
MK
228At run time,
229the dynamic linker determines the ABI version of the running kernel and
43151de3 230will reject loading shared objects that specify minimum ABI versions
eeb25d47 231that exceed that ABI version.
2a86152e 232.IP
eeb25d47
MK
233.BR LD_ASSUME_KERNEL
234can be used to
235cause the dynamic linker to assume that it is running on a system with
236a different kernel ABI version.
237For example, the following command line causes the
238dynamic linker to assume it is running on Linux 2.2.5 when loading
43151de3 239the shared objects required by
eeb25d47 240.IR myprog :
2a86152e 241.IP
eeb25d47
MK
242.in +4n
243.nf
244$ \fBLD_ASSUME_KERNEL=2.2.5 ./myprog\fP
245.fi
246.in
2a86152e 247.IP
43151de3 248On systems that provide multiple versions of a shared object
eeb25d47
MK
249(in different directories in the search path) that have
250different minimum kernel ABI version requirements,
251.BR LD_ASSUME_KERNEL
43151de3 252can be used to select the version of the object that is used
eeb25d47 253(dependent on the directory search order).
2a86152e 254.IP
eeb25d47 255Historically, the most common use of the
8a94e783 256.BR LD_ASSUME_KERNEL
eeb25d47
MK
257feature was to manually select the older
258LinuxThreads POSIX threads implementation on systems that provided both
259LinuxThreads and NPTL
260c8fcd
MK
260(which latter was typically the default on such systems);
261see
262.BR pthreads (7).
eeb25d47 263.TP
9a741b5b 264.BR LD_BIND_NOW " (since glibc 2.1.1)"
aa796481 265If set to a nonempty string,
e1725521
MK
266causes the dynamic linker to resolve all symbols
267at program startup instead of deferring function call resolution to the point
268when they are first referenced.
269This is useful when using a debugger.
270.TP
fea681da 271.B LD_LIBRARY_PATH
75c2bb63 272A list of directories in which to search for
e01dc26a 273ELF libraries at execution time.
75c2bb63 274The items in the list are separated by either colons or semicolons.
c13182ef 275Similar to the
fea681da
MK
276.B PATH
277environment variable.
2a86152e 278.IP
6e1064d3 279This variable is ignored in secure-execution mode.
2a86152e 280.IP
0a8909c4
MK
281Within the pathnames specified in
282.BR LD_LIBRARY_PATH ,
99194a09 283the dynamic linker expands the tokens
0a8909c4
MK
284.IR $ORIGIN ,
285.IR $LIB ,
286and
287.IR $PLATFORM
288(or the versions using curly braces around the names)
289as described above in
290.IR "Rpath token expansion" .
291Thus, for example,
292the following would cause a library to be searched for in either the
293.I lib
294or
295.I lib64
296subdirectory below the directory containing the program to be executed:
019d9ee8
MK
297.IP
298.in +4n
299.EX
300$ \fBLD_LIBRARY_PATH='$ORIGIN/$LIB' prog\fP
301.EE
302.in
303.IP
0a8909c4 304(Note the use of single quotes, which prevent expansion of
99194a09 305.I $ORIGIN
0a8909c4 306and
99194a09 307.I $LIB
0a8909c4 308as shell variables!)
fea681da
MK
309.TP
310.B LD_PRELOAD
df7ef267 311A list of additional, user-specified, ELF shared
43151de3 312objects to be loaded before all others.
df7ef267 313The items of the list can be separated by spaces or colons.
43151de3
MK
314This can be used to selectively override functions in other shared objects.
315The objects are searched for using the rules given under DESCRIPTION.
2a86152e 316.IP
24fb0923 317In secure-execution mode,
be1cf739 318preload pathnames containing slashes are ignored.
8dd4941b 319Furthermore, shared objects are preloaded only
f4279be5 320from the standard search directories and only
8fe4dd08 321if they have set-user-ID mode bit enabled (which is not typical).
2a86152e 322.IP
61c5564c
MK
323Within the names specified in the
324.BR LD_PRELOAD
99194a09 325list, the dynamic linker understands the tokens
0a8909c4
MK
326.IR $ORIGIN ,
327.IR $LIB ,
328and
329.IR $PLATFORM
330(or the versions using curly braces around the names)
331as described above in
332.IR "Rpath token expansion" .
8b2bb705
MK
333(See also the discussion of quoting under the description of
334.BR LD_LIBRARY_PATH .)
0a8909c4
MK
335.\" Tested with the following:
336.\"
337.\" LD_PRELOAD='$LIB/libmod.so' LD_LIBRARY_PATH=. ./prog
338.\"
376c2e1c 339.\" which will preload the libmod.so in 'lib' or 'lib64', using it
0a8909c4 340.\" in preference to the version in '.'.
fea681da 341.TP
dc4b358f 342.BR LD_TRACE_LOADED_OBJECTS
01132bd6 343If set (to any value), causes the program to list its dynamic
fea681da
MK
344dependencies, as if run by
345.BR ldd (1),
346instead of running normally.
dd3568a1 347.PP
fea681da
MK
348Then there are lots of more or less obscure variables,
349many obsolete or only for internal use.
350.TP
9a741b5b 351.BR LD_AUDIT " (since glibc 2.4)"
54eb2620
PB
352A colon-separated list of user-specified, ELF shared objects
353to be loaded before all others in a separate linker namespace
354(i.e., one that does not intrude upon the normal symbol bindings that
355would occur in the process).
43151de3 356These objects can be used to audit the operation of the dynamic linker.
e01dc26a 357.IP
54eb2620 358.B LD_AUDIT
24fb0923 359is ignored in secure-execution mode.
e01dc26a 360.IP
54eb2620 361The dynamic linker will notify the audit
43151de3
MK
362shared objects at so-called auditing checkpoints\(emfor example,
363loading a new shared object, resolving a symbol,
54eb2620 364or calling a symbol from another shared object\(emby
43151de3 365calling an appropriate function within the audit shared object.
54eb2620
PB
366For details, see
367.BR rtld-audit (7).
368The auditing interface is largely compatible with that provided on Solaris,
369as described in its
370.IR "Linker and Libraries Guide" ,
371in the chapter
372.IR "Runtime Linker Auditing Interface" .
e01dc26a 373.IP
61c5564c
MK
374Within the names specified in the
375.BR LD_AUDIT
99194a09 376list, the dynamic linker understands the tokens
879de6e7
MK
377.IR $ORIGIN ,
378.IR $LIB ,
379and
380.IR $PLATFORM
381(or the versions using curly braces around the names)
382as described above in
383.IR "Rpath token expansion" .
8b2bb705
MK
384(See also the discussion of quoting under the description of
385.BR LD_LIBRARY_PATH .)
e01dc26a 386.IP
50994c10
MK
387Since glibc 2.13,
388.\" commit 8e9f92e9d5d7737afdacf79b76d98c4c42980508
389in secure-execution mode,
390names in the audit list that contain slashes are ignored,
391and only shared objects in the standard search directories that
392have the set-user-ID mode bit enabled are loaded.
fea681da 393.TP
9a741b5b 394.BR LD_BIND_NOT " (since glibc 2.1.95)"
963c1947
MK
395If this environment variable is set to a nonempty string,
396do not update the GOT (global offset table) and PLT (procedure linkage table)
a3a72ad2 397after resolving a function symbol.
e5e9497f
MK
398By combining the use of this variable with
399.BR LD_DEBUG
400(with the categories
401.IR bindings
402and
403.IR symbols ),
404one can observe all run-time function bindings.
fea681da 405.TP
9a741b5b 406.BR LD_DEBUG " (since glibc 2.1)"
ac59a601 407Output verbose debugging information about operation of the dynamic linker.
e28421e9
MK
408The content of this variable is one of more of the following categories,
409separated by colons, commas, or (if the value is quoted) spaces:
410.RS
411.TP 12
412.I help
1f6bc72f
MK
413Specifying
414.IR help
415in the value of this variable does not run the specified program,
d81099fb 416and displays a help message about which categories can be specified in this
fea681da 417environment variable.
e28421e9
MK
418.TP
419.I all
420Print all debugging information (except
421.IR statistics
422and
423.IR unused ;
424see below).
425.TP
d81099fb
MK
426.I bindings
427Display information about which definition each symbol is bound to.
428.TP
429.I files
430Display progress for input file.
431.TP
432.I libs
433Display library search paths.
434.TP
435.I reloc
436Display relocation processing.
437.TP
438.I scopes
439Display scope information.
440.TP
441.I statistics
442Display relocation statistics.
443.TP
444.I symbols
445Display search paths for each symbol look-up.
446.TP
447.I unused
448Determine unused DSOs.
449.TP
450.I versions
451Display version dependencies.
452.RE
453.IP
e4c14bd9
MK
454Since glibc 2.3.4,
455.B LD_DEBUG
ae861bf1
MG
456is ignored in secure-execution mode, unless the file
457.IR /etc/suid\-debug
458exists (the content of the file is irrelevant).
fea681da 459.TP
9a741b5b 460.BR LD_DEBUG_OUTPUT " (since glibc 2.1)"
fe689ea4 461By default,
fea681da 462.B LD_DEBUG
fe689ea4
MK
463output is written to standard error.
464If
465.B LD_DEBUG_OUTPUT
466is defined, then output is written to the pathname specified by its value,
467with the suffix "." (dot) followed by the process ID appended to the pathname.
2a86152e 468.IP
097585ed 469.B LD_DEBUG_OUTPUT
24fb0923 470is ignored in secure-execution mode.
fea681da 471.TP
9a741b5b 472.BR LD_DYNAMIC_WEAK " (since glibc 2.1.91)"
3337a4a3
MK
473By default, when searching shared libraries to resolve a symbol reference,
474the dynamic linker will resolve to the first definition it finds.
2a86152e 475.IP
3337a4a3
MK
476Old glibc versions (before 2.2), provided a different behavior:
477if the linker found a symbol that was weak,
478it would remember that symbol and
479keep searching in the remaining shared libraries.
480If it subsequently found a strong definition of the same symbol,
481then it would instead use that definition.
482(If no further symbol was found,
483then the dynamic linker would use the weak symbol that it initially found.)
2a86152e 484.IP
3337a4a3 485The old glibc behavior was nonstandard.
f4279be5 486(Standard practice is that the distinction between
3337a4a3 487weak and strong symbols should have effect only at static link time.)
ae5686f6 488In glibc 2.2,
3337a4a3 489.\" More precisely 2.1.92
c595ec7e
MK
490.\" See weak handling
491.\" https://www.sourceware.org/ml/libc-hacker/2000-06/msg00029.html
492.\" To: GNU libc hacker <libc-hacker at sourceware dot cygnus dot com>
493.\" Subject: weak handling
494.\" From: Ulrich Drepper <drepper at redhat dot com>
495.\" Date: 07 Jun 2000 20:08:12 -0700
496.\" Reply-To: drepper at cygnus dot com (Ulrich Drepper)
3337a4a3
MK
497the dynamic linker was modified to provide the current behavior
498(which was the behavior that was provided by most other implementations
499at that time).
2a86152e 500.IP
3337a4a3
MK
501Defining the
502.B LD_DYNAMIC_WEAK
503environment variable (with any value) provides
504the old (nonstandard) glibc behavior,
505whereby a weak symbol in one shared library may be overridden by
506a strong symbol subsequently discovered in another shared library.
507(Note that even when this variable is set,
508a strong symbol in a shared library will not override
509a weak definition of the same symbol in the main program.)
2a86152e 510.IP
6e1064d3 511Since glibc 2.3.4,
e1725521 512.B LD_DYNAMIC_WEAK
24fb0923 513is ignored in secure-execution mode.
e1725521 514.TP
9a741b5b 515.BR LD_HWCAP_MASK " (since glibc 2.1)"
e1725521
MK
516Mask for hardware capabilities.
517.TP
9a741b5b 518.BR LD_ORIGIN_PATH " (since glibc 2.1)"
71ffb3ed 519Path where the binary is found.
578616fa
MK
520.\" Used only if $ORIGIN can't be determined by normal means
521.\" (from the origin path saved at load time, or from /proc/self/exe)?
2a86152e 522.IP
24fb0923 523Since glibc 2.4,
e1725521 524.B LD_ORIGIN_PATH
24fb0923 525is ignored in secure-execution mode.
7b0cacbb 526.TP
bdf75f3e 527.BR LD_POINTER_GUARD " (glibc from 2.4 to 2.22)"
7b0cacbb
PB
528Set to 0 to disable pointer guarding.
529Any other value enables pointer guarding, which is also the default.
530Pointer guarding is a security mechanism whereby some pointers to code
531stored in writable program memory (return addresses saved by
532.BR setjmp (3)
533or function pointers used by various glibc internals) are mangled
534semi-randomly to make it more difficult for an attacker to hijack
535the pointers for use in the event of a buffer overrun or
536stack-smashing attack.
ca1c3729
MK
537Since glibc 2.23,
538.\" commit a014cecd82b71b70a6a843e250e06b541ad524f7
539.B LD_POINTER_GUARD
540can no longer be used to disable pointer guarding,
541which is now always enabled.
fea681da 542.TP
9a741b5b 543.BR LD_PROFILE " (since glibc 2.1)"
7c7a7df3 544The name of a (single) shared object to be profiled,
8a7f3759 545specified either as a pathname or a soname.
c64ea262 546Profiling output is appended to the file whose name is:
8a7f3759 547"\fI$LD_PROFILE_OUTPUT\fP/\fI$LD_PROFILE\fP.profile".
2a86152e 548.IP
24dc407a
MK
549Since glibc 2.2.5,
550.BR LD_PROFILE
d74d5bd3 551is ignored in secure-execution mode.
fea681da 552.TP
9a741b5b 553.BR LD_PROFILE_OUTPUT " (since glibc 2.1)"
8a7f3759 554Directory where
fea681da 555.B LD_PROFILE
8a7f3759
MK
556output should be written.
557If this variable is not defined, or is defined as an empty string,
558then the default is
559.IR /var/tmp .
2a86152e 560.IP
097585ed 561.B LD_PROFILE_OUTPUT
8977c66c
MK
562is ignored in secure-execution mode; instead
563.IR /var/profile
564is always used.
24dc407a
MK
565(This detail is relevant only before glibc 2.2.5,
566since in later glibc versions,
567.B LD_PROFILE
568is also ignored in secure-execution mode.)
fea681da 569.TP
9a741b5b 570.BR LD_SHOW_AUXV " (since glibc 2.1)"
b5ccc9bb
MK
571If this environment variable is defined (with any value),
572show the auxiliary array passed up from the kernel (see also
573.BR getauxval (3)).
2a86152e 574.IP
ee955285 575Since glibc 2.3.4,
ca2bcde1 576.B LD_SHOW_AUXV
24fb0923 577is ignored in secure-execution mode.
de2a932a 578.TP
9a741b5b 579.BR LD_TRACE_PRELINKING " (since glibc 2.4)"
f416bfde 580If this environment variable is defined,
a5817257 581trace prelinking of the object whose name is assigned to
de2a932a
MK
582this environment variable.
583(Use
584.BR ldd (1)
585to get a list of the objects that might be traced.)
586If the object name is not recognized,
587.\" (This is what seems to happen, from experimenting)
588then all prelinking activity is traced.
fea681da 589.TP
9a741b5b 590.BR LD_USE_LOAD_BIAS " (since glibc 2.3.3)"
e1725521
MK
591.\" http://sources.redhat.com/ml/libc-hacker/2003-11/msg00127.html
592.\" Subject: [PATCH] Support LD_USE_LOAD_BIAS
593.\" Jakub Jelinek
2656a3fa 594By default (i.e., if this variable is not defined),
e1725521 595executables and prelinked
43151de3 596shared objects will honor base addresses of their dependent shared objects
24b74457 597and (nonprelinked) position-independent executables (PIEs)
e1725521
MK
598and other shared objects will not honor them.
599If
600.B LD_USE_LOAD_BIAS
dc70d1ea 601is defined with the value 1, both executables and PIEs
e1725521
MK
602will honor the base addresses.
603If
604.B LD_USE_LOAD_BIAS
605is defined with the value 0,
606neither executables nor PIEs will honor the base addresses.
2a86152e 607.IP
daad3ee9 608Since glibc 2.3.3, this variable is ignored in secure-execution mode.
fea681da 609.TP
9a741b5b 610.BR LD_VERBOSE " (since glibc 2.1)"
aa796481 611If set to a nonempty string,
e1725521 612output symbol versioning information about the
2216fac7 613program if the
e1725521 614.B LD_TRACE_LOADED_OBJECTS
2216fac7 615environment variable has been set.
fea681da 616.TP
dc4b358f 617.BR LD_WARN " (since glibc 2.1.3)
aa796481 618If set to a nonempty string, warn about unresolved symbols.
fea681da 619.TP
9a741b5b 620.BR LD_PREFER_MAP_32BIT_EXEC " (x86-64 only; since glibc 2.23)"
3cdc1fc4 621According to the Intel Silvermont software optimization guide, for 64-bit
5b479f37 622applications, branch prediction performance can be negatively impacted
ee8655b5 623when the target of a branch is more than 4\ GB away from the branch.
3cdc1fc4 624If this environment variable is set (to any value),
e01dc26a 625the dynamic linker
3cdc1fc4
MK
626will first try to map executable pages using the
627.BR mmap (2)
628.BR MAP_32BIT
629flag, and fall back to mapping without that flag if that attempt fails.
ee8655b5 630NB: MAP_32BIT will map to the low 2\ GB (not 4\ GB) of the address space.
2a86152e 631.IP
3cdc1fc4
MK
632Because
633.B MAP_32BIT
634reduces the address range available for address space layout
635randomization (ASLR),
636.B LD_PREFER_MAP_32BIT_EXEC
637is always disabled in secure-execution mode.
fea681da
MK
638.SH FILES
639.PD 0
640.TP
8478ee02 641.I /lib/ld.so
fea681da
MK
642a.out dynamic linker/loader
643.TP
8478ee02 644.IR /lib/ld\-linux.so. { 1 , 2 }
fea681da
MK
645ELF dynamic linker/loader
646.TP
8478ee02 647.I /etc/ld.so.cache
fea681da 648File containing a compiled list of directories in which to search for
43151de3 649shared objects and an ordered list of candidate shared objects.
a110286b
MK
650See
651.BR ldconfig (8).
fea681da 652.TP
8478ee02 653.I /etc/ld.so.preload
43151de3 654File containing a whitespace-separated list of ELF shared objects to
fea681da 655be loaded before the program.
95b6bd72
MK
656See the discussion of
657.BR LD_PRELOAD
658above.
659If both
660.BR LD_PRELOAD
661and
662.I /etc/ld.so.preload
663are employed, the libraries specified by
664.BR LD_PRELOAD
665are preloaded first.
666.I /etc/ld.so.preload
667has a system-wide effect,
668causing the specified libraries to be preloaded for
669all programs that are executed on the system.
670(This is usually undesirable,
671and is typically employed only as an emergency remedy, for example,
672as a temporary workaround to a library misconfiguration issue.)
fea681da
MK
673.TP
674.B lib*.so*
43151de3 675shared objects
fea681da
MK
676.PD
677.SH NOTES
8ce45022 678.SS Hardware capabilities
43151de3 679Some shared objects are compiled using hardware-specific instructions which do
8ce45022 680not exist on every CPU.
43151de3 681Such objects should be installed in directories whose names define the
8ce45022
MK
682required hardware capabilities, such as
683.IR /usr/lib/sse2/ .
684The dynamic linker checks these directories against the hardware of the
43151de3 685machine and selects the most suitable version of a given shared object.
8ce45022
MK
686Hardware capability directories can be cascaded to combine CPU features.
687The list of supported hardware capability names depends on the CPU.
688The following names are currently recognized:
689.TP
690.B Alpha
691ev4, ev5, ev56, ev6, ev67
692.TP
693.B MIPS
694loongson2e, loongson2f, octeon, octeon2
695.TP
696.B PowerPC
6974xxmac, altivec, arch_2_05, arch_2_06, booke, cellbe, dfp, efpdouble, efpsingle,
698fpu, ic_snoop, mmu, notb, pa6t, power4, power5, power5+, power6x, ppc32, ppc601,
699ppc64, smt, spe, ucache, vsx
700.TP
701.B SPARC
702flush, muldiv, stbar, swap, ultra3, v9, v9v, v9v2
703.TP
704.B s390
705dfp, eimm, esan3, etf3enh, g5, highgprs, hpage, ldisp, msa, stfle,
706z900, z990, z9-109, z10, zarch
707.TP
708.B x86 (32-bit only)
709acpi, apic, clflush, cmov, cx8, dts, fxsr, ht, i386, i486, i586, i686, mca, mmx,
710mtrr, pat, pbe, pge, pn, pse36, sep, ss, sse, sse2, tm
fea681da 711.SH SEE ALSO
6b432477 712.BR ld (1),
fea681da 713.BR ldd (1),
1a7735bb 714.BR pldd (1),
cf28f98a 715.BR sprof (1),
639c8860 716.BR dlopen (3),
45fa8fcb 717.BR getauxval (3),
cef5dc27 718.BR elf (5),
9894eac3 719.BR capabilities (7),
c18ecec9 720.BR rtld-audit (7),
4d96fe33
MK
721.BR ldconfig (8),
722.BR sln (8)
fea681da
MK
723.\" .SH AUTHORS
724.\" ld.so: David Engel, Eric Youngdale, Peter MacDonald, Hongjiu Lu, Linus
725.\" Torvalds, Lars Wirzenius and Mitch D'Souza
d74d5bd3 726.\" ld\-linux.so: Roland McGrath, Ulrich Drepper and others.
fea681da 727.\"
d74d5bd3 728.\" In the above, (libc5) stands for David Engel's ld.so/ld\-linux.so.