diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-07-08 13:49:17 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-07-08 13:57:52 -0700 |
commit | 661b504df9bfb8d7c5d669091720e1dc0079c05e (patch) | |
tree | cfa4e84297a9a3156071b6ab3970989f0af2c292 /ld | |
parent | a8dde0a2114f87bcdc19946aeab26788f5eae1b7 (diff) | |
download | gdb-661b504df9bfb8d7c5d669091720e1dc0079c05e.zip gdb-661b504df9bfb8d7c5d669091720e1dc0079c05e.tar.gz gdb-661b504df9bfb8d7c5d669091720e1dc0079c05e.tar.bz2 |
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.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ld-x86-64/pie3.d | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/ld/testsuite/ld-x86-64/pie3.d b/ld/testsuite/ld-x86-64/pie3.d index b943837..a20029c 100644 --- a/ld/testsuite/ld-x86-64/pie3.d +++ b/ld/testsuite/ld-x86-64/pie3.d @@ -1,12 +1,3 @@ #as: --64 #ld: -pie -melf_x86_64 --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code -#objdump: -dw - -.*: +file format .* - - -Disassembly of section .text: - -0+191 <_start>: - +191: 48 8d 05 68 fe ff ff lea -0x198\(%rip\),%rax # 0 <_start-0x191> -#pass +#error: .*relocation R_X86_64_PC32 against undefined symbol `foo' can not be used when making a PIE object; recompile with -fPIE |