summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2013-03-28 16:52:57 -0700
committerRoland McGrath <roland@hack.frob.com>2013-03-28 16:52:57 -0700
commite57b0c6100e63bfd816ae59339452eafc81f1d3a (patch)
tree679fa9bc3f13ac3f2df0249db9966b305d6e8244 /stdlib
parent288f7d79fe2dcc8e62c539f57b25d7662a2cd5ff (diff)
downloadglibc-e57b0c6100e63bfd816ae59339452eafc81f1d3a.tar.gz
glibc-e57b0c6100e63bfd816ae59339452eafc81f1d3a.tar.xz
glibc-e57b0c6100e63bfd816ae59339452eafc81f1d3a.zip
Avoid unconditional __call_tls_dtors calls in static linking.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/cxa_thread_atexit_impl.c2
-rw-r--r--stdlib/exit.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/stdlib/cxa_thread_atexit_impl.c b/stdlib/cxa_thread_atexit_impl.c
index ebf3c4ab05..dfd4c7e694 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 2e86caa2d4..270fda7b4f 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