diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2019-08-16 14:25:15 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2019-08-16 14:25:58 -0700 |
commit | 81e8046dc0daaf56fb10b11931fc77600a4b5920 (patch) | |
tree | 1068ed32d4fc01ea11136b4f2ba7990715703f3d /ld | |
parent | 398fdd6086a290748afcce0efabaebb4e363278c (diff) | |
download | gdb-81e8046dc0daaf56fb10b11931fc77600a4b5920.zip gdb-81e8046dc0daaf56fb10b11931fc77600a4b5920.tar.gz gdb-81e8046dc0daaf56fb10b11931fc77600a4b5920.tar.bz2 |
x86-64: Move PIC check for PC-relative relocations back
commit 83924b3846361f2f76f9a6e7b5afa01c0eebbd4f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Feb 5 18:45:23 2019 -0800
x86-64: Restore PIC check for PCREL reloc against protected symbol
moved PIC check for PC-relative relocations to elf_x86_64_check_relocs.
Since linker defined symbols may not be processed at the time, we need
to move the check back to elf_x86_64_relocate_section.
bfd/
PR ld/24905
* elf64-x86-64.c (elf_x86_64_check_relocs): Move PIC check for
PC-relative relocations back to ...
(elf_x86_64_relocate_section): Here.
ld/
PR ld/24905
* testsuite/ld-x86-64/pr24905-x32.d: New file.
* testsuite/ld-x86-64/pr24905.d: Likewise.
* testsuite/ld-x86-64/pr24905.s: Likewise.
* testsuite/ld-x86-64/pr24905.t: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr24905 and pr24905-x32.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr24905-x32.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr24905.d | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr24905.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr24905.t | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/x86-64.exp | 2 |
6 files changed, 33 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 34d3240..4837aac 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2019-08-16 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/24905 + * testsuite/ld-x86-64/pr24905-x32.d: New file. + * testsuite/ld-x86-64/pr24905.d: Likewise. + * testsuite/ld-x86-64/pr24905.s: Likewise. + * testsuite/ld-x86-64/pr24905.t: Likewise. + * testsuite/ld-x86-64/x86-64.exp: Run pr24905 and pr24905-x32. + 2019-08-16 Christophe Lyon <christophe.lyon@linaro.org> * emulparams/armelf.sh (OTHER_SECTIONS): Add support for noinit diff --git a/ld/testsuite/ld-x86-64/pr24905-x32.d b/ld/testsuite/ld-x86-64/pr24905-x32.d new file mode 100644 index 0000000..e2c6a73 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr24905-x32.d @@ -0,0 +1,8 @@ +#source: pr24905.s +#as: --x32 +#ld: -shared -melf32_x86_64 $srcdir/$subdir/pr24905.t +#nm: -n + +#... +[0-9a-f]* t EXTERNAL_SYM +#pass diff --git a/ld/testsuite/ld-x86-64/pr24905.d b/ld/testsuite/ld-x86-64/pr24905.d new file mode 100644 index 0000000..f11834f --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr24905.d @@ -0,0 +1,7 @@ +#as: --64 +#ld: -shared -melf_x86_64 $srcdir/$subdir/pr24905.t +#nm: -n + +#... +[0-9a-f]* t EXTERNAL_SYM +#pass diff --git a/ld/testsuite/ld-x86-64/pr24905.s b/ld/testsuite/ld-x86-64/pr24905.s new file mode 100644 index 0000000..73a5d58 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr24905.s @@ -0,0 +1,6 @@ + .text + .globl foo + .type foo, @function +foo: + leaq EXTERNAL_SYM(%rip), %rdi + .hidden EXTERNAL_SYM diff --git a/ld/testsuite/ld-x86-64/pr24905.t b/ld/testsuite/ld-x86-64/pr24905.t new file mode 100644 index 0000000..5e7dbd3 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr24905.t @@ -0,0 +1 @@ +PROVIDE_HIDDEN(EXTERNAL_SYM = ADDR(.text)); diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index d815e5d..b13cc7d 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -458,6 +458,8 @@ run_dump_test "pr24458c" run_dump_test "pr24458c-x32" run_dump_test "pr24721" run_dump_test "pr24721-x32" +run_dump_test "pr24905" +run_dump_test "pr24905-x32" if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} { return |