From c6663fee4340291cd825fd8a88c219621f4eca9d Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 11 Mar 2020 15:19:24 -0300 Subject: nptl: Move pthread_sigmask implementation to libc This is part of the libpthread removal project: A new symbol version is added on libc to force loading failure instead of lazy binding one for newly binaries with old loaders. Checked with a build against all affected ABIs. --- nptl/Makefile | 3 ++- nptl/Versions | 4 ++++ nptl/pthread_sigmask.c | 11 ++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'nptl') diff --git a/nptl/Makefile b/nptl/Makefile index e554a38..4816fa2 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -59,6 +59,7 @@ routines = \ pthread_getschedparam \ pthread_self \ pthread_setschedparam \ + pthread_sigmask \ register-atfork \ shared-only-routines = forward @@ -123,7 +124,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \ pthread_barrierattr_setpshared \ pthread_key_create pthread_key_delete \ pthread_getspecific pthread_setspecific \ - pthread_sigmask pthread_kill pthread_sigqueue \ + pthread_kill pthread_sigqueue \ pthread_cancel pthread_testcancel \ pthread_setcancelstate pthread_setcanceltype \ pthread_once \ diff --git a/nptl/Versions b/nptl/Versions index 543dddc..f7140277 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -16,6 +16,7 @@ libc { pthread_mutex_lock; pthread_mutex_unlock; pthread_self; pthread_setcancelstate; pthread_setcanceltype; + pthread_sigmask; } GLIBC_2.1 { pthread_attr_init; @@ -32,6 +33,9 @@ libc { GLIBC_2.28 { thrd_current; thrd_equal; thrd_sleep; thrd_yield; } + GLIBC_2.32 { + pthread_sigmask; + } GLIBC_PRIVATE { __libc_alloca_cutoff; # Internal libc interface to libpthread diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c index c7860e0..0351044 100644 --- a/nptl/pthread_sigmask.c +++ b/nptl/pthread_sigmask.c @@ -16,14 +16,13 @@ License along with the GNU C Library; if not, see . */ -#include #include #include #include - +#include int -pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) +__pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) { sigset_t local_newmask; @@ -47,3 +46,9 @@ pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) ? INTERNAL_SYSCALL_ERRNO (result) : 0); } + +versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_32); +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32) +strong_alias (__pthread_sigmask, __pthread_sigmask_2); +compat_symbol (libc, __pthread_sigmask_2, pthread_sigmask, GLIBC_2_0); +#endif -- cgit v1.1