summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2022-03-10 12:56:38 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2022-03-10 12:56:38 +0100
commit728e1e0ea5adf1bd9b479e4edc456b637e26c031 (patch)
tree158c2fb613d5fd88524f7e837c8751a826dc60ac
parent0844445e7358eb10e716155b55b0fb23e88d644a (diff)
xtensa: fix variable reference in TLS_LD
Use @DTPOFF instead of @TPOFF in TLS_LD as specified by the xtensa ABI. DTPOFF produces variable offset relative to the variable's module TLS block, it's the linker's job to replace it with TPOFF and adjust surrounding code when the object file is linked into an executable. This fixes tests tls/tst-tls[123] on xtensa that fail if built as PIE. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r--test/tls/tls-macros-xtensa.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/tls/tls-macros-xtensa.h b/test/tls/tls-macros-xtensa.h
index 179dc5e..90fc726 100644
--- a/test/tls/tls-macros-xtensa.h
+++ b/test/tls/tls-macros-xtensa.h
@@ -15,7 +15,7 @@
__asm__ ("movi a8, _TLS_MODULE_BASE_@TLSFUNC\n\t" \
"movi a10, _TLS_MODULE_BASE_@TLSARG\n\t" \
"callx8.tls a8, _TLS_MODULE_BASE_@TLSCALL\n\t" \
- "movi %0, " #x "@TPOFF\n\t" \
+ "movi %0, " #x "@DTPOFF\n\t" \
"add %0, %0, a10\n\t" \
: "=r" (__l) \
: \
@@ -38,7 +38,7 @@
__asm__ ("movi a0, _TLS_MODULE_BASE_@TLSFUNC\n\t" \
"movi a2, _TLS_MODULE_BASE_@TLSARG\n\t" \
"callx0.tls a0, _TLS_MODULE_BASE_@TLSCALL\n\t" \
- "movi %0, " #x "@TPOFF\n\t" \
+ "movi %0, " #x "@DTPOFF\n\t" \
"add %0, %0, a2\n\t" \
: "=r" (__l) \
: \