aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2013-08-27 11:04:46 -0700
committerRoland McGrath <roland@hack.frob.com>2013-08-27 11:04:46 -0700
commitfb431262c12a8e2630225518300a4e1e0c4e918b (patch)
tree4b91f8e7d6246a1a6680500add0c4075b8f018ea
parentbd81123a8ba99ac30bcf227be5103cf2863e27cb (diff)
downloadglibc-fb431262c12a8e2630225518300a4e1e0c4e918b.tar
glibc-fb431262c12a8e2630225518300a4e1e0c4e918b.tar.gz
glibc-fb431262c12a8e2630225518300a4e1e0c4e918b.tar.bz2
glibc-fb431262c12a8e2630225518300a4e1e0c4e918b.zip
Clean up _res declaration to use __thread unconditionally.
-rw-r--r--ChangeLog7
-rw-r--r--include/resolv.h18
-rw-r--r--resolv/res_libc.c4
3 files changed, 13 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index e73a301361..d5fc59bd79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2013-08-27 Roland McGrath <roland@hack.frob.com>
+ * include/resolv.h [_RESOLV_H_]:
+ Don't include <tls.h>.
+ (__resp, _res): Move declaration and macro out of [_LIBC_REENTRANT].
+ * resolv/res_libc.c: Don't include <tls.h>.
+ (_res): Use __attribute__ ((nocommon)) in place of
+ __attribute__ ((section (".bss"))).
+
* Makefile ($(common-objpfx)linkobj/libc_pic.a):
If [sunrpc not in $(subdirs)], define to use libc_pic.a directly.
diff --git a/include/resolv.h b/include/resolv.h
index 30ea8776b5..87b3598330 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -13,20 +13,12 @@
#ifdef _RESOLV_H_
-# ifdef _LIBC_REENTRANT
-# include <tls.h>
-# undef _res
-# ifndef NOT_IN_libc
-# define __resp __libc_resp
-# endif
-# define _res (*__resp)
-extern __thread struct __res_state *__resp attribute_tls_model_ie;
-# else
-# ifndef __BIND_NOSTATIC
-# undef _res
-extern struct __res_state _res;
-# endif
+# ifndef NOT_IN_libc
+# define __resp __libc_resp
# endif
+extern __thread struct __res_state *__resp attribute_tls_model_ie;
+# undef _res
+# define _res (*__resp)
/* Now define the internal interfaces. */
extern int __res_vinit (res_state, int);
diff --git a/resolv/res_libc.c b/resolv/res_libc.c
index 48d3200b7e..0b37f46aea 100644
--- a/resolv/res_libc.c
+++ b/resolv/res_libc.c
@@ -122,9 +122,7 @@ libc_hidden_def (__res_maybe_init)
This differs from plain `struct __res_state _res;' in that it doesn't
create a common definition, but a plain symbol that resides in .bss,
which can have an alias. */
-struct __res_state _res __attribute__((section (".bss")));
-
-#include <tls.h>
+struct __res_state _res __attribute__ ((nocommon));
#undef __resp
__thread struct __res_state *__resp = &_res;