aboutsummaryrefslogtreecommitdiff
path: root/elf/tls-macros.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-11 01:49:22 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-11 01:49:22 +0000
commit7331ca4db23f3b43686be221277cb9ed6fea2511 (patch)
tree3d2c6fb2c6cdcdbc1c2361577b3f32c81c05468d /elf/tls-macros.h
parentf1cc669a8c8d1845e9fc350e52687f79ba6bd552 (diff)
downloadglibc-7331ca4db23f3b43686be221277cb9ed6fea2511.tar
glibc-7331ca4db23f3b43686be221277cb9ed6fea2511.tar.gz
glibc-7331ca4db23f3b43686be221277cb9ed6fea2511.tar.bz2
glibc-7331ca4db23f3b43686be221277cb9ed6fea2511.zip
Update.
* po/fr.po: Update from translation team. * elf/tls-macros.h: Add alternative macros for use in PIC.
Diffstat (limited to 'elf/tls-macros.h')
-rw-r--r--elf/tls-macros.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/elf/tls-macros.h b/elf/tls-macros.h
index c3018b83b1..35b57d4f04 100644
--- a/elf/tls-macros.h
+++ b/elf/tls-macros.h
@@ -2,13 +2,18 @@
#define COMMON_INT_DEF(x) \
asm (".tls_common " #x ",4,4")
+/* XXX Until we get compiler support we don't need declarations. */
+#define COMMON_INT_DECL(x)
/* XXX This definition will probably be machine specific, too. */
#define VAR_INT_DEF(x) \
asm (".section .tdata\n\t" \
".globl " #x "\n" \
#x ":\t.long 0\n\t" \
+ ".size " #x ",4\n\t" \
".previous")
+/* XXX Until we get compiler support we don't need declarations. */
+#define VAR_INT_DECL(x)
/* XXX Each architecture must have its own asm for now. */
@@ -20,7 +25,15 @@
: "=r" (__l)); \
__l; })
-#define TLS_IE(x) \
+# ifdef PIC
+# define TLS_IE(x) \
+ ({ int *__l; \
+ asm ("movl %%gs:0,%0\n\t" \
+ "subl " #x "@gottpoff(%%ebx),%0" \
+ : "=r" (__l)); \
+ __l; })
+# else
+# define TLS_IE(x) \
({ int *__l, __b; \
asm ("call 1f\n\t" \
".subsection 1\n" \
@@ -32,8 +45,18 @@
"subl " #x "@gottpoff(%%ebx),%0" \
: "=r" (__l), "=&b" (__b)); \
__l; })
+# endif
-#define TLS_LD(x) \
+# ifdef PIC
+# define TLS_LD(x) \
+ ({ int *__l; \
+ asm ("leal " #x "@tlsldm(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "leal " #x "@dtpoff(%%eax), %%eax" \
+ : "=a" (__l)); \
+ __l; })
+# else
+# define TLS_LD(x) \
({ int *__l, __b; \
asm ("call 1f\n\t" \
".subsection 1\n" \
@@ -46,8 +69,18 @@
"leal " #x "@dtpoff(%%eax), %%eax" \
: "=a" (__l), "=&b" (__b)); \
__l; })
+# endif
-#define TLS_GD(x) \
+# ifdef PIC
+# define TLS_GD(x) \
+ ({ int *__l; \
+ asm ("leal " #x "@tlsgd(%%ebx),%%eax\n\t" \
+ "call ___tls_get_addr@plt\n\t" \
+ "nop" \
+ : "=a" (__l)); \
+ __l; })
+# else
+# define TLS_GD(x) \
({ int *__l, __b; \
asm ("call 1f\n\t" \
".subsection 1\n" \
@@ -60,6 +93,7 @@
"nop" \
: "=a" (__l), "=&b" (__b)); \
__l; })
+# endif
#else
# error "No support for this architecture so far."