about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/bits/libc-tsd.h3
-rw-r--r--sysdeps/generic/errno-loc.c6
-rw-r--r--sysdeps/generic/errno.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h2
5 files changed, 8 insertions, 7 deletions
diff --git a/sysdeps/generic/bits/libc-tsd.h b/sysdeps/generic/bits/libc-tsd.h
index cc2c2c1219..d39382952a 100644
--- a/sysdeps/generic/bits/libc-tsd.h
+++ b/sysdeps/generic/bits/libc-tsd.h
@@ -52,7 +52,8 @@
    translate directly into variables by macro magic.  */
 
 #if USE___THREAD
-# define __libc_tsd_define(CLASS, KEY)	CLASS __thread void *__libc_tsd_##KEY;
+# define __libc_tsd_define(CLASS, KEY)	\
+  CLASS __thread void *__libc_tsd_##KEY attribute_tls_model_ie;
 
 # define __libc_tsd_address(KEY)	(&__libc_tsd_##KEY)
 # define __libc_tsd_get(KEY)		(__libc_tsd_##KEY)
diff --git a/sysdeps/generic/errno-loc.c b/sysdeps/generic/errno-loc.c
index bda9fa4211..032b48306c 100644
--- a/sysdeps/generic/errno-loc.c
+++ b/sysdeps/generic/errno-loc.c
@@ -20,11 +20,9 @@
 
 #include <errno.h>
 #include <tls.h>
-#undef errno
 
-#if USE_TLS && HAVE___THREAD
-extern __thread int errno;
-#else
+#if !(USE_TLS && HAVE___THREAD)
+#undef errno
 extern int errno;
 #endif
 
diff --git a/sysdeps/generic/errno.c b/sysdeps/generic/errno.c
index cba5ab9c3b..e33c6b88ad 100644
--- a/sysdeps/generic/errno.c
+++ b/sysdeps/generic/errno.c
@@ -23,6 +23,8 @@
 
 #if USE___THREAD
 __thread int errno;
+extern __thread int __libc_errno __attribute__ ((alias ("errno")))
+  attribute_hidden;
 #else
 /* This differs from plain `int errno;' in that it doesn't create
    a common definition, but a plain symbol that resides in .bss,
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index f6763b14f2..4c907f2d4a 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -114,7 +114,7 @@ __i686.get_pc_thunk.reg:						      \
 #   define SYSCALL_ERROR_HANDLER					      \
 0:SETUP_PIC_REG (cx);							      \
   addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
-  movl errno@gotntpoff(%ecx), %ecx;					      \
+  movl __libc_errno@GOTNTPOFF(%ecx), %ecx;				      \
   xorl %edx, %edx;							      \
   subl %eax, %edx;							      \
   movl %edx, %gs:0(%ecx);						      \
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index de6bb44d9f..adccc50bba 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -95,7 +95,7 @@
 #elif USE___THREAD
 # define SYSCALL_ERROR_HANDLER			\
 0:						\
-  movq errno@GOTTPOFF(%rip), %rcx;		\
+  movq __libc_errno@GOTTPOFF(%rip), %rcx;	\
   xorq %rdx, %rdx;				\
   subq %rax, %rdx;				\
   movl %edx, %fs:(%rcx);			\