binutils-gdb/ld/testsuite/ld-x86-64/pie3.d
H.J. Lu 661b504df9 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.
2021-07-08 13:57:52 -07:00

4 lines
225 B
Makefile

#as: --64
#ld: -pie -melf_x86_64 --hash-style=sysv -z max-page-size=0x200000 -z noseparate-code
#error: .*relocation R_X86_64_PC32 against undefined symbol `foo' can not be used when making a PIE object; recompile with -fPIE