summaryrefslogtreecommitdiff
path: root/resolv
diff options
context:
space:
mode:
Diffstat (limited to 'resolv')
-rw-r--r--resolv/res-close.c7
-rw-r--r--resolv/resolv-internal.h3
-rw-r--r--resolv/resolv_conf.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/resolv/res-close.c b/resolv/res-close.c
index e02f5afa15..38572b1d2f 100644
--- a/resolv/res-close.c
+++ b/resolv/res-close.c
@@ -126,8 +126,8 @@ res_nclose (res_state statp)
libc_hidden_def (__res_nclose)
/* This is called when a thread is exiting to free resources held in _res. */
-static void __attribute__ ((section ("__libc_thread_freeres_fn")))
-res_thread_freeres (void)
+void
+__res_thread_freeres (void)
{
__resolv_context_freeres ();
@@ -140,5 +140,4 @@ res_thread_freeres (void)
/* Make sure we do a full re-initialization the next time. */
_res.options = 0;
}
-text_set_element (__libc_thread_subfreeres, res_thread_freeres);
-text_set_element (__libc_subfreeres, res_thread_freeres);
+text_set_element (__libc_subfreeres, __res_thread_freeres);
diff --git a/resolv/resolv-internal.h b/resolv/resolv-internal.h
index ac6e495927..b8e447c726 100644
--- a/resolv/resolv-internal.h
+++ b/resolv/resolv-internal.h
@@ -97,4 +97,7 @@ int __res_nopt (struct resolv_context *, int n0,
int __inet_pton_length (int af, const char *src, size_t srclen, void *);
libc_hidden_proto (__inet_pton_length)
+/* Called as part of the thread shutdown sequence. */
+void __res_thread_freeres (void) attribute_hidden;
+
#endif /* _RESOLV_INTERNAL_H */
diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c
index ab4e5dc82c..b4021ab735 100644
--- a/resolv/resolv_conf.c
+++ b/resolv/resolv_conf.c
@@ -673,8 +673,7 @@ __resolv_conf_detach (struct __res_state *resp)
}
/* Deallocate the global data. */
-static void __attribute__ ((section ("__libc_thread_freeres_fn")))
-freeres (void)
+libc_freeres_fn (freeres)
{
/* No locking because this function is supposed to be called when
the process has turned single-threaded. */
@@ -698,4 +697,3 @@ freeres (void)
deallocated memory. */
global = NULL;
}
-text_set_element (__libc_subfreeres, freeres);