diff options
| author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-03-11 15:19:24 -0300 |
|---|---|---|
| committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-04-21 14:01:58 -0300 |
| commit | c6663fee4340291cd825fd8a88c219621f4eca9d (patch) | |
| tree | f8dd659610efa8dcd8de0f4cbac48af46cd26a8d | |
| parent | 8645f624697afecfaa4d97ac584bc0a943cbca17 (diff) | |
| download | glibc-c6663fee4340291cd825fd8a88c219621f4eca9d.tar.xz glibc-c6663fee4340291cd825fd8a88c219621f4eca9d.zip | |
nptl: Move pthread_sigmask implementation to libc
This is part of the libpthread removal project:
<https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>
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.
61 files changed, 77 insertions, 34 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index e554a3898d..4816fa254e 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 543dddc4ee..f7140277f5 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 c7860e02a5..035104453f 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 <https://www.gnu.org/licenses/>. */ -#include <errno.h> #include <signal.h> #include <pthreadP.h> #include <sysdep.h> - +#include <shlib-compat.h> 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 diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index a4c31932cb..41bb214bb9 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -1447,6 +1447,7 @@ GLIBC_2.17 pthread_self F GLIBC_2.17 pthread_setcancelstate F GLIBC_2.17 pthread_setcanceltype F GLIBC_2.17 pthread_setschedparam F +GLIBC_2.17 pthread_sigmask F GLIBC_2.17 ptrace F GLIBC_2.17 ptsname F GLIBC_2.17 ptsname_r F @@ -2145,3 +2146,4 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 pthread_sigmask F diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist index d65beba958..48b368acb1 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist @@ -156,7 +156,6 @@ GLIBC_2.17 pthread_setconcurrency F GLIBC_2.17 pthread_setname_np F GLIBC_2.17 pthread_setschedprio F GLIBC_2.17 pthread_setspecific F -GLIBC_2.17 pthread_sigmask F GLIBC_2.17 pthread_sigqueue F GLIBC_2.17 pthread_spin_destroy F GLIBC_2.17 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile index 2e132e474b..92484bbe65 100644 --- a/sysdeps/unix/sysv/linux/alpha/Makefile +++ b/sysdeps/unix/sysv/linux/alpha/Makefile @@ -31,9 +31,9 @@ libm-routines += multc3 divtc3 endif # math ifeq ($(subdir),nptl) -# pull in __syscall_error routine, __sigprocmask, sigaction stubs. -libpthread-routines += sysdep sigprocmask rt_sigaction -libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction +# pull in __syscall_error routine, sigaction stubs. +libpthread-routines += sysdep rt_sigaction +libpthread-shared-only-routines += sysdep rt_sigaction endif ifeq ($(subdir),conform) diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index e7f2174ac2..6430af207f 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -891,6 +891,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F @@ -2225,6 +2226,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 pthread_sigmask F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist index ffd443422d..cfffc5f529 100644 --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index b152c0e24a..f4ea1756d5 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -133,6 +133,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.32 pthread_sigmask F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 @@ -1517,6 +1518,7 @@ GLIBC_2.4 pthread_self F GLIBC_2.4 pthread_setcancelstate F GLIBC_2.4 pthread_setcanceltype F GLIBC_2.4 pthread_setschedparam F +GLIBC_2.4 pthread_sigmask F GLIBC_2.4 ptrace F GLIBC_2.4 ptsname F GLIBC_2.4 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist index 129c64b0a7..050e799de8 100644 --- a/sysde |
