mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
fa85fb9a1b
The AArch64 TLSDESC to IE relaxation code uses a bit mask intended to ensure that destination register in a relaxed ldr instruction is always X0. The mask has an off by one error resulting in the most significant bit of the destination register being retained in the relaxed instruction. The issue generally appears when the compiler emits TLS accesses code under high register pressure resulting in a broken code sequence.
14 lines
215 B
ArmAsm
14 lines
215 B
ArmAsm
.global var
|
|
.section .tdata
|
|
var:
|
|
.word 2
|
|
.text
|
|
adrp x0, :tlsdesc:var
|
|
ldr x17, [x0, #:tlsdesc_lo12:var]
|
|
add x0, x0, :tlsdesc_lo12:var
|
|
.tlsdesccall var
|
|
blr x1
|
|
mrs x1, tpidr_el0
|
|
add x0, x1, x0
|
|
ldr w0, [x0]
|