summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions6
-rw-r--r--nptl/cleanup.c24
-rw-r--r--nptl/pthreadP.h13
4 files changed, 26 insertions, 19 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index bbd599785e..68f27c15df 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -31,6 +31,7 @@ extra-libs-others := $(extra-libs)
 routines = \
   alloca_cutoff \
   cancellation \
+  cleanup \
   cleanup_compat \
   cleanup_defer_compat \
   cleanup_routine \
@@ -195,7 +196,6 @@ shared-only-routines = forward
 static-only-routines = pthread_atfork
 
 libpthread-routines = \
-  cleanup \
   cleanup_defer \
   events \
   libpthread-compat \
diff --git a/nptl/Versions b/nptl/Versions
index 0045780806..7a47f9bbca 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -151,6 +151,8 @@ libc {
   }
   GLIBC_2.3.3 {
     __pthread_cleanup_routine;
+    __pthread_register_cancel;
+    __pthread_unregister_cancel;
     __pthread_unwind_next;
     pthread_attr_getaffinity_np;
     pthread_attr_setaffinity_np;
@@ -234,6 +236,8 @@ libc {
     __pthread_key_create;
     __pthread_mutex_lock;
     __pthread_mutex_unlock;
+    __pthread_register_cancel;
+    __pthread_unregister_cancel;
     call_once;
     cnd_broadcast;
     cnd_destroy;
@@ -437,9 +441,7 @@ libpthread {
   }
 
   GLIBC_2.3.3 {
-    __pthread_register_cancel;
     __pthread_register_cancel_defer;
-    __pthread_unregister_cancel;
     __pthread_unregister_cancel_restore;
     pthread_setaffinity_np;
   }
diff --git a/nptl/cleanup.c b/nptl/cleanup.c
index ad1651577b..040786fc44 100644
--- a/nptl/cleanup.c
+++ b/nptl/cleanup.c
@@ -18,11 +18,11 @@
 
 #include <stdlib.h>
 #include "pthreadP.h"
-
+#include <shlib-compat.h>
 
 void
 __cleanup_fct_attribute
-__pthread_register_cancel (__pthread_unwind_buf_t *buf)
+___pthread_register_cancel (__pthread_unwind_buf_t *buf)
 {
   struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
   struct pthread *self = THREAD_SELF;
@@ -34,15 +34,29 @@ __pthread_register_cancel (__pthread_unwind_buf_t *buf)
   /* Store the new cleanup handler info.  */
   THREAD_SETMEM (self, cleanup_jmp_buf, (struct pthread_unwind_buf *) buf);
 }
-hidden_def (__pthread_register_cancel)
+versioned_symbol (libc, ___pthread_register_cancel,
+                  __pthread_register_cancel, GLIBC_2_34);
+libc_hidden_ver (___pthread_register_cancel, __pthread_register_cancel)
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_register_cancel,
+               __pthread_register_cancel, GLIBC_2_3_3);
+#endif
 
 
 void
 __cleanup_fct_attribute
-__pthread_unregister_cancel (__pthread_unwind_buf_t *buf)
+___pthread_unregister_cancel (__pthread_unwind_buf_t *buf)
 {
   struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
 
   THREAD_SETMEM (THREAD_SELF, cleanup_jmp_buf, ibuf->priv.data.prev);
 }
-hidden_def (__pthread_unregister_cancel)
+versioned_symbol (libc, ___pthread_unregister_cancel,
+                  __pthread_unregister_cancel, GLIBC_2_34);
+libc_hidden_ver (___pthread_unregister_cancel, __pthread_unregister_cancel)
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_34)
+compat_symbol (libpthread, ___pthread_unregister_cancel,
+               __pthread_unregister_cancel, GLIBC_2_3_3);
+#endif
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 7e3cef4709..1692788528 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -277,21 +277,12 @@ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
 /* NB: No hidden proto for __pthread_unwind_next: inside glibc, the
    legacy unwinding mechanism is used.  */
 
-#if IS_IN (libpthread)
 extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
      __cleanup_fct_attribute;
+libc_hidden_proto (__pthread_register_cancel)
 extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
      __cleanup_fct_attribute;
-hidden_proto (__pthread_register_cancel)
-hidden_proto (__pthread_unregister_cancel)
-# ifdef SHARED
-/* The difference from __libc_unwind_link_get is that here, errors
-   terminate the process.  */
-struct unwind_link ;
-struct unwind_link *__pthread_unwind_link_get (void) attribute_hidden;
-# endif
-#endif
-
+libc_hidden_proto (__pthread_unregister_cancel)
 
 /* Called when a thread reacts on a cancellation request.  */
 static inline void