about summary refs log tree commit diff
path: root/sysdeps/s390/s390-64/tls-macros.h
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>2013-11-29 09:57:04 +0100
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2013-11-29 09:57:04 +0100
commitacd98a8ed1460497e788c701eb92616f1df9b446 (patch)
treecc50555e7ba16b16ac0e43366f4f1747980353b9 /sysdeps/s390/s390-64/tls-macros.h
parent7475aef5fa2b5ca414117bd667520ba64ad75807 (diff)
downloadglibc-acd98a8ed1460497e788c701eb92616f1df9b446.tar.gz
glibc-acd98a8ed1460497e788c701eb92616f1df9b446.tar.xz
glibc-acd98a8ed1460497e788c701eb92616f1df9b446.zip
[BZ #16214] S/390: Fix TLS GOT pointer setup.
Diffstat (limited to 'sysdeps/s390/s390-64/tls-macros.h')
-rw-r--r--sysdeps/s390/s390-64/tls-macros.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/sysdeps/s390/s390-64/tls-macros.h b/sysdeps/s390/s390-64/tls-macros.h
index be8aa6cde0..3c59436341 100644
--- a/sysdeps/s390/s390-64/tls-macros.h
+++ b/sysdeps/s390/s390-64/tls-macros.h
@@ -8,12 +8,13 @@
 
 #ifdef PIC
 # define TLS_IE(x) \
-  ({ unsigned long __offset;						      \
-     asm ("bras %0,1f\n"						      \
-	  "0:\t.quad " #x "@gotntpoff\n"				      \
-	  "1:\tlg %0,0(%0)\n\t"						      \
-	  "lg %0,0(%0,%%r12):tls_load:" #x				      \
-	  : "=&a" (__offset) : : "cc" );				      \
+  ({ unsigned long __offset, __got;					      \
+     asm ("bras %0,0f\n\t"						      \
+	  ".quad " #x "@gotntpoff\n"					      \
+	  "0:\tlarl %1,_GLOBAL_OFFSET_TABLE_\n\t"			      \
+	  "lg %0,0(%0)\n\t"						      \
+	  "lg %0,0(%0,%1):tls_load:" #x	"\n"				      \
+	  : "=&a" (__offset), "=&a" (__got) : : "cc" );			      \
      (int *) (__builtin_thread_pointer() + __offset); })
 #else
 # define TLS_IE(x) \