aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-11-12 11:20:31 +1030
committerFlorian Weimer <fweimer@redhat.com>2023-01-10 17:03:43 +0100
commitd9923235f012cdaeb3dff097e11660b7f5e5b00a (patch)
tree1355080c1f68ee911c5db11caac962395df97b88 /sysdeps/powerpc
parent293211b6fddf60fc407d21fcba0326dd2148f76b (diff)
downloadglibc-d9923235f012cdaeb3dff097e11660b7f5e5b00a.zip
glibc-d9923235f012cdaeb3dff097e11660b7f5e5b00a.tar.gz
glibc-d9923235f012cdaeb3dff097e11660b7f5e5b00a.tar.bz2
elf/tst-tlsopt-powerpc fails when compiled with -mcpu=power10 (BZ# 29776)
Supports pcrel addressing of TLS GOT entry. Also tweak the non-pcrel asm constraint to better reflect how the reg is used. (cherry picked from commit 94628de77888c3292fc103840731ff85f283368e)
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/mod-tlsopt-powerpc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdeps/powerpc/mod-tlsopt-powerpc.c b/sysdeps/powerpc/mod-tlsopt-powerpc.c
index 2a82e53..d941024 100644
--- a/sysdeps/powerpc/mod-tlsopt-powerpc.c
+++ b/sysdeps/powerpc/mod-tlsopt-powerpc.c
@@ -22,7 +22,11 @@ tls_get_addr_opt_test (void)
tls_index *tls_arg;
#ifdef __powerpc64__
register unsigned long thread_pointer __asm__ ("r13");
- asm ("addi %0,2,foo@got@tlsgd" : "=r" (tls_arg));
+# ifdef __PCREL__
+ asm ("paddi %0,0,foo@got@tlsgd@pcrel,1" : "=b" (tls_arg));
+# else
+ asm ("addi %0,2,foo@got@tlsgd" : "=b" (tls_arg));
+# endif
#else
register unsigned long thread_pointer __asm__ ("r2");
asm ("bcl 20,31,1f\n1:\t"