binutils-gdb/ld/testsuite/ld-arm/tls-gdesc-neg.s
Szabolcs Nagy b627f56244 [PR ld/25062] arm: sign extend the addend of R_ARM_TLS_GOTDESC
On 64-bit host the 32-bit addend was loaded without sign extension into
an unsigned long.

bfd/ChangeLog:

	PR ld/25062
	* elf32-arm.c (elf32_arm_final_link_relocate): Sign extend data.

ld/ChangeLog:

	PR ld/25062
	* testsuite/ld-arm/arm-elf.exp: Update.
	* testsuite/ld-arm/tls-gdesc-neg.d: New test.
	* testsuite/ld-arm/tls-gdesc-neg.s: New test.
2019-10-04 10:54:16 +01:00

30 lines
414 B
ArmAsm

.text
.arm
.globl foo
.type foo, %function
foo:
ldr r0, 1f
b 2f
1:
@ Negative addend for R_ARM_TLS_GOTDESC.
.word tlsdata(tlsdesc) + (. - 2f + 0)
2:
blx tlsdata(tlscall)
.thumb
.globl bar
.type bar, %function
bar:
ldr r0, 1f
b 2f
1:
@ Negative addend for R_ARM_TLS_GOTDESC.
.word tlsdata(tlsdesc) + (. - 2f + 1)
2:
blx tlsdata(tlscall)
.section .tdata,"awT"
.global tlsdata
tlsdata:
.space 4