x86-64: Disallow PC reloc against weak undefined symbols in PIE
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 8 Jul 2021 20:49:17 +0000 (13:49 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 8 Jul 2021 20:57:52 +0000 (13:57 -0700)
commit661b504df9bfb8d7c5d669091720e1dc0079c05e
treecfa4e84297a9a3156071b6ab3970989f0af2c292
parenta8dde0a2114f87bcdc19946aeab26788f5eae1b7
x86-64: Disallow PC reloc against weak undefined symbols in PIE

Disallow PC relocations against weak undefined symbols in PIE since they
can lead to non-zero address at run-time.

bfd/

PR ld/21782
* elf64-x86-64.c (elf_x86_64_relocate_section): Disallow PC
relocations against weak undefined symbols in PIE.

ld/

PR ld/21782
* testsuite/ld-x86-64/pie3.d: Expect linker error.
bfd/elf64-x86-64.c
ld/testsuite/ld-x86-64/pie3.d