OSDN Git Service

Add IFUNC support for arm64 and IRELATIVE reloc
authorDmitriy Ivanov <dimitry@google.com>
Thu, 11 Sep 2014 22:16:03 +0000 (15:16 -0700)
committerDmitriy Ivanov <dimitry@google.com>
Wed, 1 Oct 2014 23:04:31 +0000 (16:04 -0700)
commitf4cb6313645ef65cc0eea0a439e51b6788cd3439
tree816f1591e6861e041ec75a8a8181e662ee18e605
parentef1306d77718cc74a8df5673a15649dea317571d
Add IFUNC support for arm64 and IRELATIVE reloc

 There are number of changes in the way IFUNC related relocations are done:
 1. IRELATIVE relocations are now supported for x86/x86_64 and arm64.
 2. IFUNC relocations are now relying on static linker to generate
    them in correct order - this removes necessety of additional
    relocation pass for ifuncs.
 3. Related to 2: rela?.dyn relocations are preformed before .plt ones.
 4. Ifunc are resolved on symbol lookup this approach allowed to avoid
    mprotect(PROT_WRITE) call on r-x program segments.

Bug: 17399706
Bug: 17177284

(cherry picked from commit 9aea164457c269c475592da36b4655d45f55c7bc)

Change-Id: Ie19d900fc203beb93faf8943b0d06d534a6de4ad
libc/arch-arm64/include/machine/elf_machdep.h
libc/arch-x86/include/machine/elf_machdep.h
libc/arch-x86_64/include/machine/elf_machdep.h
linker/dlfcn.cpp
linker/linker.cpp
linker/linker.h
tests/Android.build.mk
tests/dlfcn_test.cpp
tests/libs/Android.mk
tests/libs/dlopen_testlib_ifunc.c