summaryrefslogtreecommitdiff
path: root/sysdeps/s390/s390-32/tls-macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/s390/s390-32/tls-macros.h')
-rw-r--r--sysdeps/s390/s390-32/tls-macros.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/sysdeps/s390/s390-32/tls-macros.h b/sysdeps/s390/s390-32/tls-macros.h
index 09b42aa37a..153523a4ae 100644
--- a/sysdeps/s390/s390-32/tls-macros.h
+++ b/sysdeps/s390/s390-32/tls-macros.h
@@ -8,15 +8,17 @@
#ifdef PIC
# define TLS_IE(x) \
- ({ unsigned long __offset, __got; \
+ ({ unsigned long __offset, __save12; \
__asm__ ("bras %0,1f\n" \
"0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \
".long " #x "@gotntpoff\n" \
- "1:\tl %1,0(%0)\n\t" \
- "la %1,0(%1,%0)\n\t" \
+ "1:\tlr %1,%%r12\n\t" \
+ "l %%r12,0(%0)\n\t" \
+ "la %%r12,0(%0,%%r12)\n\t" \
"l %0,4(%0)\n\t" \
- "l %0,0(%0,%1):tls_load:" #x "\n" \
- : "=&a" (__offset), "=&a" (__got) : : "cc" ); \
+ "l %0,0(%0,%%r12):tls_load:" #x "\n\t" \
+ "lr %%r12,%1\n" \
+ : "=&a" (__offset), "=&a" (__save12) : : "cc" ); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_IE(x) \
@@ -47,7 +49,7 @@
"alr %0,%%r2\n\t" \
"lr %%r12,%1" \
: "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5" ); \
+ : : "cc", "0", "1", "2", "3", "4", "5", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_LD(x) \
@@ -63,7 +65,8 @@
"bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \
"l %0,12(%0)\n\t" \
"alr %0,%%r2" \
- : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
+ : "=&a" (__offset) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#endif
@@ -83,7 +86,7 @@
"lr %0,%%r2\n\t" \
"lr %%r12,%1" \
: "=&a" (__offset), "=&a" (__save12) \
- : : "cc", "0", "1", "2", "3", "4", "5" ); \
+ : : "cc", "0", "1", "2", "3", "4", "5", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#else
# define TLS_GD(x) \
@@ -97,6 +100,7 @@
"l %%r2,8(%0)\n\t" \
"bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \
"lr %0,%%r2" \
- : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \
+ : "=&a" (__offset) \
+ : : "cc", "0", "1", "2", "3", "4", "5", "12", "14"); \
(int *) (__builtin_thread_pointer() + __offset); })
#endif