This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch roland/weak-tls-dors created. glibc-2.17-462-g6a8851e


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  6a8851e986cf2a5091b92c0424c9b706369e03c1 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6a8851e986cf2a5091b92c0424c9b706369e03c1

commit 6a8851e986cf2a5091b92c0424c9b706369e03c1
Author: Roland McGrath <roland@hack.frob.com>
Date:   Mon Mar 25 11:36:11 2013 -0700

    Avoid unconditional __call_tls_dtors calls in static linking.

diff --git a/ChangeLog b/ChangeLog
index 24c472b..8048472 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-03-25  Roland McGrath  <roland@hack.frob.com>
+
+	* include/stdlib.h [!SHARED] (__call_tls_dtors):
+	Declare with __attribute__ ((weak)).
+	* stdlib/exit.c (__libc_atexit) [!SHARED]:
+	Call __call_tls_dtors only if it's not NULL.
+
 2013-03-24  Mark H Weaver  <mhw@netris.org>
 
 	* manual/arith.texi (Normalization Functions): Fix prototypes for
diff --git a/include/stdlib.h b/include/stdlib.h
index db1812d..e50985a 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -102,8 +102,12 @@ 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)
+#ifndef SHARED
+  __attribute__ ((weak))
+#endif
+  ;
+libc_hidden_proto (__call_tls_dtors)
 
 extern void __cxa_finalize (void *d);
 
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 707744a..4336ae7 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-25  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..dfd4c7e 100644
--- a/stdlib/cxa_thread_atexit_impl.c
+++ b/stdlib/cxa_thread_atexit_impl.c
@@ -76,7 +76,7 @@ __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.  */
 void
 __call_tls_dtors (void)
 {
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]