]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Calculate relocation base for the main object, and apply the relocation
authorkib <kib@FreeBSD.org>
Sat, 10 Oct 2009 15:27:10 +0000 (15:27 +0000)
committerkib <kib@FreeBSD.org>
Sat, 10 Oct 2009 15:27:10 +0000 (15:27 +0000)
commit69e50b966ca53e391bd55d3f7a8889a4f52e0df6
treead6fab5fadacc126cd73299882dd9e2f4bd6fc5b
parent87a472715d25d03a998dbd9388da266a7416f555
Calculate relocation base for the main object, and apply the relocation
adjustment for all virtual addresses encoded into the ELF structures of
it. PIE binary could and should be loaded at non-zero mapbase.

For sym_zero pseudosymbol used as a return value from find_symdef()
for undefined weak symbols, st_value also should be adjusted, since
_rtld_bind corrects symbol values by relocbase.

Discussed with: bz
Reviewed by: kan
Tested by: bz (i386, amd64), bsam (linux)
MFC after: some time
libexec/rtld-elf/rtld.c