diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-05-14 03:55:37 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-05-14 03:55:50 -0700 |
commit | 4ec0995016801cc5d5cf13baf6e10163861e6852 (patch) | |
tree | f2aa11725ad03aec8080cb88b6415c7fcdf2098f /ld/testsuite/ld-ifunc/pr23169c.rd | |
parent | 9bc935ef3380a2d471b9447e2bf8e61297654e2f (diff) | |
download | binutils-gdb-4ec0995016801cc5d5cf13baf6e10163861e6852.tar.gz |
x86; Allow IFUNC pointer defined in PDE
If IFUNC symbol is defined in position-dependent executable, we should
change it to the normal function and set its address to its PLT entry
which should be resolved by R_*_IRELATIVE at run-time. All external
references should be resolved to its PLT in executable.
bfd/
PR ld/23169
* elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Don't issue
an error on IFUNC pointer defined in PDE.
* elf32-i386.c (elf_i386_finish_dynamic_symbol): Call
_bfd_x86_elf_link_fixup_ifunc_symbol.
* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
* elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): New
function.
* elfxx-x86.h (_bfd_x86_elf_link_fixup_ifunc_symbol): New.
ld/
PR ld/23169
* testsuite/ld-ifunc/ifunc-9-i386.d: New file.
* testsuite/ld-ifunc/ifunc-9-x86-64.d: Likewise.
* testsuite/ld-ifunc/pr23169a.c: Likewise.
* testsuite/ld-ifunc/pr23169a.rd: Likewise.
* testsuite/ld-ifunc/pr23169b.c: Likewise.
* testsuite/ld-ifunc/pr23169b.c: Likewise.
* testsuite/ld-ifunc/pr23169c.rd: Likewise.
* testsuite/ld-ifunc/pr23169c.rd: Likewise.
* testsuite/ld-ifunc/ifunc-9-x86.d: Removed.
* testsuite/ld-ifunc/ifunc.exp: Run PR ld/23169 tests.
Diffstat (limited to 'ld/testsuite/ld-ifunc/pr23169c.rd')
-rw-r--r-- | ld/testsuite/ld-ifunc/pr23169c.rd | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ld/testsuite/ld-ifunc/pr23169c.rd b/ld/testsuite/ld-ifunc/pr23169c.rd new file mode 100644 index 00000000000..1c4ba8ad4a5 --- /dev/null +++ b/ld/testsuite/ld-ifunc/pr23169c.rd @@ -0,0 +1,6 @@ + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: +[a-f0-9]+ +[0-9]+ +IFUNC +GLOBAL +DEFAULT +[0-9]+ +func +#... |