old-cross-binutils/ld/testsuite/ld-arm/ifunc-gdesc.s
Will Newton 9f19ab6dfa ld/ARM: Fix IFUNC and TLS descriptors in the same shared object
Combining TLS descriptors and GNU indirect functions in the same
object could lead to assertions or multiple dynamic relocations
for the same GOT slot. Fix the bookkeeping so this doesn't happen.

This allows building and make checking glibc with -mtls-dialect=gnu2.

bfd/ChangeLog:

2014-06-16  Will Newton  <will.newton@linaro.org>

	* elf32-arm.c (elf32_arm_allocate_plt_entry): Increment
	htab->next_tls_desc_index in the non-IPLT case.
	Calculate GOT offset correctly for the non-IPLT case.
	(allocate_dynrelocs_for_symbol): Don't increment
	htab->next_tls_desc_index here.

ld/testsuite/ChangeLog:

2014-06-16  Will Newton  <will.newton@linaro.org>

	* ld-arm/arm-elf.exp: Add ifunc-gdesc test.
	* ld-arm/ifunc-gdesc.r: New file.
	* ld-arm/ifunc-gdesc.s: Likewise.
	* ld-arm/ifunc-gdesc.ver: Likewise.
2014-06-16 15:51:21 +01:00

29 lines
384 B
ArmAsm

.arm
foo:
bl ifunc1(PLT)
ldr r0,1f
2: bl loc1(tlscall)
nop
1: .word loc1(tlsdesc) + (. - 2b)
ldr r0,1f
2: bl loc2(tlscall)
nop
1: .word loc2(tlsdesc) + (. - 2b)
.type ifunc1,%gnu_indirect_function
.global ifunc1
ifunc1:
mov pc,lr
.size ifunc1,.-ifunc1
.section .tdata,"awT",%progbits
.space 8
.type loc1, %object
loc1: .space 4
.type loc2, %object
loc2: .space 4