rtld: Add STT_GNU_IFUNC and R_MACHINE_IRELATIVE_GNU support
authorJohn Marino <draco@marino.st>
Sat, 21 Jan 2012 23:00:15 +0000 (00:00 +0100)
committerJohn Marino <draco@marino.st>
Mon, 23 Jan 2012 16:13:18 +0000 (17:13 +0100)
commit0e63a289be0e5b68be98ed583e6cf069f47ef7fa
tree45da10bf9b1972fd564712756294d81fda3630f5
parent153ab39206bda82ee461410163ae0f433bcb2629
rtld: Add STT_GNU_IFUNC and R_MACHINE_IRELATIVE_GNU support

Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to
rtld. This adds runtime bits neccessary for the use of the dispatch
functions from the dynamically-linked executables and shared libraries.

To allow use of external references from the dispatch function, resolution
of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT entries
for PLT are prepared, and normal resolution of the GOT entries is finished.
Similar to how it is done by GNU, IRELATIVE relocations are resolved in
advance, instead of normal lazy handling for PLT.

Taken-from:
FreeBSD SVN 228435 (12 DEC 2011)
FreeBSD SVN 228503 (14 DEC 2011)
FreeBSD SVN 229508 (04 JAN 2012)
libexec/rtld-elf/i386/reloc.c
libexec/rtld-elf/rtld.c
libexec/rtld-elf/rtld.h
libexec/rtld-elf/x86_64/reloc.c
sys/cpu/i386/include/elf.h
sys/cpu/x86_64/include/elf.h
sys/sys/elf_common.h