]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf/tst-tlsopt-powerpc fails when compiled with -mcpu=power10 (BZ# 29776)
authorAlan Modra <amodra@gmail.com>
Sat, 12 Nov 2022 00:50:31 +0000 (11:20 +1030)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 10 Jan 2023 15:26:37 +0000 (16:26 +0100)
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)

NEWS
sysdeps/powerpc/mod-tlsopt-powerpc.c

diff --git a/NEWS b/NEWS
index fb2d73a6be4324fc73c282567ec7687e7e3bff1f..dbe2b2e301dfaa34309fa2df77a61da2a79db0c2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,7 @@ The following bugs are resolved with this release:
     platforms
   [29730] broken y2038 support in fstatat on MIPS N64
   [29771] Restore IPC_64 support in sysvipc *ctl functions
+  [29776] elf/tst-tlsopt-powerpc fails when compiled with -mcpu=power10
 \f
 Version 2.36
 
index 2a82e53bafe9d0eb3e8df7cdf5bc17fb3df7dd88..d941024963fc7e6a65cc6388185f3a596ba6fb2f 100644 (file)
@@ -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"