binutils-gdb/ld/testsuite/ld-x86-64/pr22929.s
H.J. Lu 347a87745e x86: Treat relocation against IFUNC symbol as FUNC
When resolving a relocation against IFUNC symbol in a SHT_NOTE section
without SHF_ALLOC, we treat it as relocation against FUNC symbol since
it needs the address of IFUNC symbol, not the address returned by IFUNC
function.

bfd/

	PR ld/22929
	* elf32-i386.c (elf_i386_relocate_section): Treat relocation
	against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
	relocation against FUNC symbol.
	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.

ld/

	PR ld/22929
	* testsuite/ld-i386/i386.exp: Run PR ld/22929 test.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/ld-i386/pr22929.d: New file.
	* testsuite/ld-i386/pr22929.s: Likewise.
	* testsuite/ld-x86-64/pr22929.d: Likewise.
	* testsuite/ld-x86-64/pr22929.s: Likewise.
2018-03-08 06:36:52 -08:00

22 lines
474 B
ArmAsm

.text
.globl foo
.type foo, %gnu_indirect_function
foo:
ret
.size foo, .-foo
.pushsection .gnu.build.attributes, "", %note
.dc.l 6 # size of name
.dc.l 16 # descsz = sizeof (addresses)
.dc.l 0x101 # type = FUNC
.dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0 # name (numeric: -fstack-protector status)
.dc.b 0, 0 # Padding
.dc.a foo
.dc.a foo_end # description (symbol name)
.popsection
foo_end:
.section .rodata.cst4,"aM",@progbits,4
.align 4
.LC0:
.long 1065353216