ld.so.8: Tweaks to H.J. Lu's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-12-16 14:59:39 +01:00
parent 5b479f37b6
commit 3cdc1fc4a1
1 changed files with 14 additions and 5 deletions

View File

@ -474,13 +474,22 @@ If set to a nonempty string, warn about unresolved symbols.
.TP
.B LD_PREFER_MAP_32BIT_EXEC
(x86-64 only)(glibc since 2.23)
According to Silvermont software optimization guide, for 64-bit
According to the Intel Silvermont software optimization guide, for 64-bit
applications, branch prediction performance can be negatively impacted
when the target of a branch is more than 4GB away from the branch.
If set, ld.so will try to map executable pages with MAP_32BIT first.
NB: MAP_32BIT will map to lower 2GB, not lower 4GB, address. Since
MAP_32BIT reduces bits available for address space layout randomization
(ASLR), LD_PREFER_MAP_32BIT_EXEC is always disabled for SUID programs.
If this environment variable is set (to any value),
.BR ld.so
will first try to map executable pages using the
.BR mmap (2)
.BR MAP_32BIT
flag, and fall back to mapping without that flag if that attempt fails.
NB: MAP_32BIT will map to the low 2GB (not 2GB) of the address space.
Because
.B MAP_32BIT
reduces the address range available for address space layout
randomization (ASLR),
.B LD_PREFER_MAP_32BIT_EXEC
is always disabled in secure-execution mode.
.TP
.B LDD_ARGV0
(libc5)