about summary refs log tree commit diff
path: root/nptl/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/init.c')
-rw-r--r--nptl/init.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/nptl/init.c b/nptl/init.c
index 7a6dec5935..d0f1fc3be7 100644
--- a/nptl/init.c
+++ b/nptl/init.c
@@ -67,6 +67,8 @@ static const char nptl_version[] __attribute_used__ = VERSION;
 extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
 #endif
 
+static void nptl_freeres (void);
+
 
 #ifdef SHARED
 static const struct pthread_functions pthread_functions =
@@ -128,7 +130,7 @@ static const struct pthread_functions pthread_functions =
     .ptr__nptl_deallocate_tsd = __nptl_deallocate_tsd,
     .ptr__nptl_setxid = __nptl_setxid,
     /* For now only the stack cache needs to be freed.  */
-    .ptr_freeres = __free_stack_cache
+    .ptr_freeres = nptl_freeres
   };
 # define ptr_pthread_functions &pthread_functions
 #else
@@ -136,6 +138,18 @@ static const struct pthread_functions pthread_functions =
 #endif
 
 
+/* This function is called indirectly from the freeres code in libc.  */
+static void
+__libc_freeres_fn_section
+nptl_freeres (void)
+{
+#ifdef SHARED
+  __unwind_freeres ();
+#endif
+  __free_stacks (0);
+}
+
+
 /* For asynchronous cancellation we use a signal.  This is the handler.  */
 static void
 sigcancel_handler (int sig, siginfo_t *si, void *ctx)