mirror of https://github.com/mkerrisk/man-pages
ld.so.8: Rework rpath token expansion text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
2216fac709
commit
eeb25d4700
54
man8/ld.so.8
54
man8/ld.so.8
|
@ -85,19 +85,20 @@ and then
|
||||||
If the binary was linked with the
|
If the binary was linked with the
|
||||||
.B \-z nodeflib
|
.B \-z nodeflib
|
||||||
linker option, this step is skipped.
|
linker option, this step is skipped.
|
||||||
.SS $ORIGIN and rpath
|
.SS Rpath token expansion
|
||||||
.PP
|
.PP
|
||||||
.B ld.so
|
.B ld.so
|
||||||
understands the string
|
understands certain strings in an rpath specification (DT_RPATH or DT_RUNPATH); those strings are substituted as follows
|
||||||
.I $ORIGIN
|
.TP
|
||||||
(or equivalently
|
.IR $ORIGIN " (or equivalently " ${ORIGIN} )
|
||||||
.IR ${ORIGIN} )
|
This expands to
|
||||||
in an rpath specification (DT_RPATH or DT_RUNPATH) to mean
|
|
||||||
the directory containing the application executable.
|
the directory containing the application executable.
|
||||||
Thus, an application located in
|
Thus, an application located in
|
||||||
.I somedir/app
|
.I somedir/app
|
||||||
could be compiled with
|
could be compiled with
|
||||||
.I gcc -Wl,-rpath,\(aq$ORIGIN/../lib\(aq
|
|
||||||
|
gcc -Wl,-rpath,\(aq$ORIGIN/../lib\(aq
|
||||||
|
|
||||||
so that it finds an associated shared library in
|
so that it finds an associated shared library in
|
||||||
.I somedir/lib
|
.I somedir/lib
|
||||||
no matter where
|
no matter where
|
||||||
|
@ -178,6 +179,45 @@ mtrr, pat, pbe, pge, pn, pse36, sep, ss, sse, sse2, tm
|
||||||
.SH ENVIRONMENT
|
.SH ENVIRONMENT
|
||||||
There are four important environment variables.
|
There are four important environment variables.
|
||||||
.TP
|
.TP
|
||||||
|
.B LD_ASSUME_KERNEL
|
||||||
|
(glibc since 2.2.3)
|
||||||
|
Each shared library can inform the dynamic linker of the minimum kernel ABI
|
||||||
|
version that it requires.
|
||||||
|
(This requirement is encoded in an ELF note section that is typically named
|
||||||
|
.IR .note.ABI-tag .)
|
||||||
|
At run time,
|
||||||
|
the dynamic linker determines the ABI version of the running kernel and
|
||||||
|
will reject loading shared libraries that specify minimum ABI versions
|
||||||
|
that exceed that ABI version.
|
||||||
|
|
||||||
|
.BR LD_ASSUME_KERNEL
|
||||||
|
can be used to
|
||||||
|
cause the dynamic linker to assume that it is running on a system with
|
||||||
|
a different kernel ABI version.
|
||||||
|
For example, the following command line causes the
|
||||||
|
dynamic linker to assume it is running on Linux 2.2.5 when loading
|
||||||
|
the shared libraries required by
|
||||||
|
.IR myprog :
|
||||||
|
|
||||||
|
.in +4n
|
||||||
|
.nf
|
||||||
|
$ \fBLD_ASSUME_KERNEL=2.2.5 ./myprog\fP
|
||||||
|
.fi
|
||||||
|
.in
|
||||||
|
|
||||||
|
On systems that provide multiple versions of a shared library
|
||||||
|
(in different directories in the search path) that have
|
||||||
|
different minimum kernel ABI version requirements,
|
||||||
|
.BR LD_ASSUME_KERNEL
|
||||||
|
can be used to select the version of the library that is used
|
||||||
|
(dependent on the directory search order).
|
||||||
|
Historically, the most common use of the
|
||||||
|
.BR LD_ASSUME_KERNEL
|
||||||
|
feature was to manually select the older
|
||||||
|
LinuxThreads POSIX threads implementation on systems that provided both
|
||||||
|
LinuxThreads and NPTL
|
||||||
|
(which latter was typically the default on such systems).
|
||||||
|
.TP
|
||||||
.B LD_BIND_NOT
|
.B LD_BIND_NOT
|
||||||
(glibc since 2.2)
|
(glibc since 2.2)
|
||||||
Don't update the Global Offset Table (GOT) and Procedure Linkage Table (PLT)
|
Don't update the Global Offset Table (GOT) and Procedure Linkage Table (PLT)
|
||||||
|
|
Loading…
Reference in New Issue