aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-10-15 22:50:43 +0000
committerRoland McGrath <roland@gnu.org>2002-10-15 22:50:43 +0000
commit9b21e6bcf8986e076ca8aa4862bb76b76605e591 (patch)
tree9654d1175dfcc8eb8d7cfd9dc8958b207d988e4f /sysdeps/generic
parent146a03db8950595fe7ce64e4c9c397746d92d4b9 (diff)
downloadglibc-9b21e6bcf8986e076ca8aa4862bb76b76605e591.tar
glibc-9b21e6bcf8986e076ca8aa4862bb76b76605e591.tar.gz
glibc-9b21e6bcf8986e076ca8aa4862bb76b76605e591.tar.bz2
glibc-9b21e6bcf8986e076ca8aa4862bb76b76605e591.zip
2002-10-16 Jakub Jelinek <jakub@redhat.com>
* include/libc-symbols.h (attribute_tls_model_ie): Define. * include/errno.h (errno): Define to __libc_errno in libc.so. Add attribute_tls_model_ie. * include/netdb.h (h_errno): Define to __libc_h_errno in libc.so. Add attribute_tls_model_ie. * include/resolv.h (_res): Define to __libc_res in libc.so. Add attribute_tls_model_ie. * inet/herrno.c (__libc_h_errno): Add hidden alias to h_errno. (h_errno): Define. * resolv/res_libc.c (__libc_res): Add hidden alias to _res. (_res): Define. * sysdeps/generic/bits/libc-tsd.h (__libc_tsd_define): Add attribute_tls_model_ie. * sysdeps/generic/errno-loc.c (errno): Only undefine if not using __thread. * sysdeps/generic/errno.c (__libc_errno): Add hidden alias to errno. * sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER): Use __libc_errno in USE___THREAD case. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): Likewise. * configure.in (HAVE_TLS_MODEL_ATTRIBUTE): Check for __attribute__((tls_model (""))). * configure: Rebuilt. * config.h.in (HAVE_TLS_MODEL_ATTRIBUTE): Add.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/bits/libc-tsd.h3
-rw-r--r--sysdeps/generic/errno-loc.c6
-rw-r--r--sysdeps/generic/errno.c2
3 files changed, 6 insertions, 5 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,