From e57b0c6100e63bfd816ae59339452eafc81f1d3a Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 28 Mar 2013 16:52:57 -0700 Subject: Avoid unconditional __call_tls_dtors calls in static linking. --- stdlib/exit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'stdlib/exit.c') 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 -- cgit v1.1