aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-11 11:38:46 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-11 20:20:58 +0200
commit3ec8b1c7a921baa673ad9a33e0c63b4571915caa (patch)
tree6305b6505cef23c6bbffb2d44a92cb767c181445 /nptl
parent870218fb30a83c071b53b036d1eb33df7e30397e (diff)
downloadglibc-3ec8b1c7a921baa673ad9a33e0c63b4571915caa.zip
glibc-3ec8b1c7a921baa673ad9a33e0c63b4571915caa.tar.gz
glibc-3ec8b1c7a921baa673ad9a33e0c63b4571915caa.tar.bz2
nptl: Move __pthread_register_cancel, __pthread_unregister_cancel to libc
The symbols were moved using scripts/move-symbol-to-libc.py. Also clean up some unwinder linking leftover in the same spot in nptl/pthreadP.h. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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 bbd5997..68f27c1 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 0045780..7a47f9b 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 ad16515..040786f 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 7e3cef4..1692788 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