diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-11-14 10:13:03 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-11-14 10:13:03 -0800 |
commit | 9d734efa1034d266249751978f95a686ec9d19c6 (patch) | |
tree | de4ee5005311f667ecf988c38819711f7277f145 /bfd | |
parent | 35fd2ddeb1d90f1750401cfb6d01fe055656b88d (diff) | |
download | gdb-9d734efa1034d266249751978f95a686ec9d19c6.zip gdb-9d734efa1034d266249751978f95a686ec9d19c6.tar.gz gdb-9d734efa1034d266249751978f95a686ec9d19c6.tar.bz2 |
Also check GOT PLT for R_X86_64_PLTOFF64
Since "-z now" replaces PLT with GOT PLT, we should also check GOT PLT
for R_X86_64_PLTOFF64 relocation.
bfd/
PR ld/20800
* elf64-x86-64.c (elf_x86_64_relocate_section): Also check
plt_got.offset for R_X86_64_PLTOFF64.
ld/
PR ld/20800
* testsuite/ld-x86-64/pr20800a.S: New file.
* testsuite/ld-x86-64/pr20800b.S: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/20800 test.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 521e319..b8ae634 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2016-11-14 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/20800 + * elf64-x86-64.c (elf_x86_64_relocate_section): Also check + plt_got.offset for R_X86_64_PLTOFF64. + 2016-11-14 Nick Clifton <nickc@redhat.com> * coffcode.h (coff_slurp_symbol_table): Fix typo: Faal -> Fall. diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 76f09bd..05a4776 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -4693,10 +4693,17 @@ do_ifunc_pointer: symbols it's the symbol itself relative to GOT. */ if (h != NULL /* See PLT32 handling. */ - && h->plt.offset != (bfd_vma) -1 + && (h->plt.offset != (bfd_vma) -1 + || eh->plt_got.offset != (bfd_vma) -1) && htab->elf.splt != NULL) { - if (htab->plt_bnd != NULL) + if (eh->plt_got.offset != (bfd_vma) -1) + { + /* Use the GOT PLT. */ + resolved_plt = htab->plt_got; + plt_offset = eh->plt_got.offset; + } + else if (htab->plt_bnd != NULL) { resolved_plt = htab->plt_bnd; plt_offset = eh->plt_bnd.offset; |