summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/exit.c')
-rw-r--r--lib/libc/stdlib/exit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/stdlib/exit.c b/lib/libc/stdlib/exit.c
index a656e04..521d05a 100644
--- a/lib/libc/stdlib/exit.c
+++ b/lib/libc/stdlib/exit.c
@@ -63,6 +63,12 @@ exit(int status)
_thread_autoinit_dummy_decl = 1;
+ /*
+ * We're dealing with cleaning up thread_local destructors in the case of
+ * the process termination through main() exit.
+ * Other cases are handled elsewhere.
+ */
+ __cxa_thread_call_dtors();
__cxa_finalize(NULL);
if (__cleanup)
(*__cleanup)();
OpenPOWER on IntegriCloud