x86-64: Move PIC check for PC-relative relocations back
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 16 Aug 2019 21:25:15 +0000 (14:25 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 16 Aug 2019 21:25:58 +0000 (14:25 -0700)
commit81e8046dc0daaf56fb10b11931fc77600a4b5920
tree1068ed32d4fc01ea11136b4f2ba7990715703f3d
parent398fdd6086a290748afcce0efabaebb4e363278c
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.
bfd/ChangeLog
bfd/elf64-x86-64.c
ld/ChangeLog
ld/testsuite/ld-x86-64/pr24905-x32.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24905.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24905.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr24905.t [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp