]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
x86-64: Disallow PC reloc against weak undefined symbols in PIE
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 8 Jul 2021 21:03:53 +0000 (14:03 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 8 Jul 2021 21:04:40 +0000 (14:04 -0700)
commitcce64d8d01ba1558f9fc93775b9d96b40a019199
tree4d61a3528a44b3f2e351fd2ed4ceb0086ad7b16e
parent26672a41ea554bee2346143f889483615779320d
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.

(cherry picked from commit 661b504df9bfb8d7c5d669091720e1dc0079c05e)
bfd/ChangeLog
bfd/elf64-x86-64.c
ld/ChangeLog
ld/testsuite/ld-x86-64/pie3.d