mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
cefdd1cd64
If a custom linker script with an unexpected relative layout of .got and .got.plt sections was used, gold might produce a wrong offset when applying R_AARCH64_TLSDESC_* relocations. This patch fixes the issue by calculating "got_tlsdesc_offset" in a more direct way. gold/ * aarch64.cc (Target_aarch64::Relocate::relocate_tls): Make got_tlsdesc_offset signed and fix its calculation. * testsuite/Makefile.am (aarch64_tlsdesc): New test. * testsuite/Makefile.in: Regenerate. * testsuite/aarch64_tlsdesc.s: New test source file. * testsuite/aarch64_tlsdesc.sh: New test script. * testsuite/aarch64_tlsdesc.t: New test linker script.
13 lines
277 B
ArmAsm
13 lines
277 B
ArmAsm
.global test, var
|
|
.text
|
|
test:
|
|
adrp x0, :tlsdesc:var
|
|
ldr x1, [x0, :tlsdesc_lo12:var]
|
|
add x0, x0, :tlsdesc_lo12:var
|
|
.tlsdesccall var
|
|
blr x1
|
|
|
|
.section .tbss,"awT",%nobits
|
|
var:
|
|
.zero 4
|