This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch roland/weak-tls-dors created. glibc-2.17-449-gd09b058
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 20 Mar 2013 22:40:12 -0000
- Subject: GNU C Library master sources branch roland/weak-tls-dors created. glibc-2.17-449-gd09b058
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, roland/weak-tls-dors has been created
at d09b058174c93d0ada3dab8c2970040e30fe234e (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d09b058174c93d0ada3dab8c2970040e30fe234e
commit d09b058174c93d0ada3dab8c2970040e30fe234e
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Mar 20 15:38:45 2013 -0700
Avoid unconditional __call_tls_dtors calls in static linking.
diff --git a/ChangeLog b/ChangeLog
index e873eed..5fadc75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-03-20 Roland McGrath <roland@hack.frob.com>
+
+ * include/stdlib.h (__call_tls_dtors): Declare with attribute_hidden.
+ Drop libc_hidden_proto. Declare with __attribute__ ((weak)).
+ * stdlib/cxa_thread_atexit_impl.c (__call_tls_dtors): Define with
+ attribute_hidden. Drop libc_hidden_def.
+ * stdlib/exit.c (__libc_atexit) [!SHARED]:
+ Call __call_tls_dtors only if it's not NULL.
+
2013-03-20 Joseph Myers <joseph@codesourcery.com>
* aclocal.m4 (LIBC_CONFIG_VAR): New autoconf macro.
diff --git a/include/stdlib.h b/include/stdlib.h
index db1812d..d177ace 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -102,8 +102,7 @@ extern int __cxa_atexit_internal (void (*func) (void *), void *arg, void *d)
extern int __cxa_thread_atexit_impl (void (*func) (void *), void *arg,
void *d);
-extern void __call_tls_dtors (void);
-libc_hidden_proto (__call_tls_dtors);
+extern void __call_tls_dtors (void) attribute_hidden __attribute__ ((weak));
extern void __cxa_finalize (void *d);
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 707744a..921bcd8 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-20 Roland McGrath <roland@hack.frob.com>
+
+ * pthread_create.c (start_thread) [!SHARED]:
+ Call __call_tls_dtors only if it's not NULL.
+
2013-03-19 Siddhesh Poyarekar <siddhesh@redhat.com>
* allocatestack.c (allocate_stack): Use __default_pthread_attr
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index c18278c..c43077f 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -312,7 +312,10 @@ start_thread (void *arg)
}
/* Call destructors for the thread_local TLS variables. */
- __call_tls_dtors ();
+#ifndef SHARED
+ if (&__call_tls_dtors != NULL)
+#endif
+ __call_tls_dtors ();
/* Run the destructor for the thread-local data. */
__nptl_deallocate_tsd ();
diff --git a/stdlib/cxa_thread_atexit_impl.c b/stdlib/cxa_thread_atexit_impl.c
index ebf3c4a..e87720b 100644
--- a/stdlib/cxa_thread_atexit_impl.c
+++ b/stdlib/cxa_thread_atexit_impl.c
@@ -76,7 +76,8 @@ __cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
}
/* Call the destructors. This is called either when a thread returns from the
- initial function or when the process exits via the exit(3) function. */
+ initial function or when the process exits via the exit function. */
+attribute_hidden
void
__call_tls_dtors (void)
{
@@ -99,4 +100,3 @@ __call_tls_dtors (void)
free (cur);
}
}
-libc_hidden_def (__call_tls_dtors)
diff --git a/stdlib/exit.c b/stdlib/exit.c
index 2e86caa..270fda7 100644
--- a/stdlib/exit.c
+++ b/stdlib/exit.c
@@ -34,7 +34,10 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
bool run_list_atexit)
{
/* First, call the TLS destructors. */
- __call_tls_dtors ();
+#ifndef SHARED
+ if (&__call_tls_dtors != NULL)
+#endif
+ __call_tls_dtors ();
/* We do it this way to handle recursive calls to exit () made by
the functions registered with `atexit' and `on_exit'. We call
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources