x86: Treat relocation against IFUNC symbol as FUNC
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 8 Mar 2018 14:36:40 +0000 (06:36 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 8 Mar 2018 14:36:52 +0000 (06:36 -0800)
commit347a87745eab23d8427349787bde4a938a1e8c3e
tree61bd3dccb63977b684ce6097e55953e3dd3c3de6
parentbd5dea8822e515faf305690ca5c5281132d95587
x86: Treat relocation against IFUNC symbol as FUNC

When resolving a relocation against IFUNC symbol in a SHT_NOTE section
without SHF_ALLOC, we treat it as relocation against FUNC symbol since
it needs the address of IFUNC symbol, not the address returned by IFUNC
function.

bfd/

PR ld/22929
* elf32-i386.c (elf_i386_relocate_section): Treat relocation
against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
relocation against FUNC symbol.
* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.

ld/

PR ld/22929
* testsuite/ld-i386/i386.exp: Run PR ld/22929 test.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr22929.d: New file.
* testsuite/ld-i386/pr22929.s: Likewise.
* testsuite/ld-x86-64/pr22929.d: Likewise.
* testsuite/ld-x86-64/pr22929.s: Likewise.
bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c
ld/ChangeLog
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/pr22929.d [new file with mode: 0644]
ld/testsuite/ld-i386/pr22929.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr22929.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr22929.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp