freebsd-dev/libexec
Ed Maste ebf8934652 rtld: do not rely on a populated GOT on amd64
On rela architectures GNU BFD ld and gold store the relocation addend
in GOT entries (in addition to the relocation's r_addend field).
rtld previously relied on this to access its own _DYNAMIC symbol in
order to apply its own relocations.

However, recording addends in the GOT is not specified by the ABI,
and some versions of LLVM's LLD linker leave the GOT uninitialized on
rela architectures.

BFD ld does not populate the GOT on sparc64, and sparc64 rtld has a
machine-dependent rtld_dynamic_addr() function that returns the
_DYNAMIC address. Use the same approach on amd64, obtaining the %rip-
relative _DYNAMIC address following a suggestion from Rafael Espíndola.

Architectures other than amd64 should be addressed in future work.

PR:		214972
Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9180
2017-01-16 14:49:29 +00:00
..
atf
atrun
blacklistd-helper
bootpd
comsat
dma
fingerd
ftpd Fix build when WITHOUT_BLACKLIST=yes is specified 2016-11-12 03:07:41 +00:00
getty
hyperv
mail.local
makewhatis.local
mknetid
pppoed
rbootd
revnetgroup
rlogind
rpc.rquotad
rpc.rstatd
rpc.rusersd
rpc.rwalld
rpc.sprayd
rshd
rtld-aout
rtld-elf rtld: do not rely on a populated GOT on amd64 2017-01-16 14:49:29 +00:00
save-entropy
smrsh
talkd Don't use high precision clock for expiration as only second portion is 2016-12-26 17:23:09 +00:00
tcpd
telnetd
tests
tftp-proxy
tftpd Conditionalize all code that uses tcpd.h behind LIBWRAP guard 2017-01-06 04:27:07 +00:00
ulog-helper
ypxfr
Makefile
Makefile.amd64
Makefile.i386
Makefile.inc
Makefile.pc98