Message ID | 8796069624b7ecb1a21f713da7e49295af151e2c.1615569355.git.fweimer@redhat.com |
---|---|
State | New |
Headers | show |
Series | Repost of pending libpthread removal patches | expand |
On 12/03/2021 14:49, Florian Weimer via Libc-alpha wrote: > The definitions in libc are sufficient, the forwarders are no longer > needed. > > The symbols have been moved using scripts/move-symbol-to-libc.py. > s390-linux-gnu and s390x-linux-gnu need a new version placeholder > to keep the GLIBC_2.19 symbol version in libpthread. > > Tested on i386-linux-gnu, powerpc64le-linux-gnu, s390x-linux-gnu, > x86_64-linux-gnu. Built with build-many-glibcs.py. Patch looks good, I was working on a similar one as well. The only suggestion is to keep the x86 _Static_assert regarding the priv field in struct pthread_unwind_buf has space to store shadow stack pointer. I have done it by adding a new x86 longjmp implementation: diff --git a/sysdeps/unix/sysv/linux/x86/longjmp.c b/sysdeps/unix/sysv/linux/x86/longjmp.c new file mode 100644 index 0000000000..104592fd48 --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86/longjmp.c @@ -0,0 +1,39 @@ +/* __libc_siglongjmp for Linux/x86 + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <sysdeps/x86/longjmp.c> + +#include <nptl/pthreadP.h> +#include <jmp_buf-ssp.h> + +#ifdef __x86_64__ +# define SHADOW_STACK_POINTER_SIZE 8 +#else +# define SHADOW_STACK_POINTER_SIZE 4 +#endif + +/* Assert that the priv field in struct pthread_unwind_buf has space + to store shadow stack pointer. */ +_Static_assert ((offsetof (struct pthread_unwind_buf, priv) + <= SHADOW_STACK_POINTER_OFFSET) + && ((offsetof (struct pthread_unwind_buf, priv) + + sizeof (((struct pthread_unwind_buf *) 0)->priv)) + >= (SHADOW_STACK_POINTER_OFFSET + + SHADOW_STACK_POINTER_SIZE)), + "Shadow stack pointer is not within private storage " + "of pthread_unwind_buf."); > --- > nptl/Makefile | 1 - > nptl/Versions | 2 - > nptl/pt-longjmp.c | 49 ------------- > .../sysv/linux/aarch64/libpthread.abilist | 2 - > .../unix/sysv/linux/alpha/libpthread.abilist | 2 - > .../unix/sysv/linux/arm/be/libpthread.abilist | 2 - > .../unix/sysv/linux/arm/le/libpthread.abilist | 2 - > .../unix/sysv/linux/hppa/libpthread.abilist | 2 - > .../unix/sysv/linux/i386/libpthread.abilist | 2 - > .../unix/sysv/linux/ia64/libpthread.abilist | 2 - > .../linux/m68k/coldfire/libpthread.abilist | 2 - > .../sysv/linux/m68k/m680x0/libpthread.abilist | 2 - > .../linux/microblaze/be/libpthread.abilist | 2 - > .../linux/microblaze/le/libpthread.abilist | 2 - > .../sysv/linux/mips/mips32/libpthread.abilist | 2 - > .../sysv/linux/mips/mips64/libpthread.abilist | 2 - > .../unix/sysv/linux/nios2/libpthread.abilist | 2 - > .../powerpc/powerpc32/libpthread.abilist | 4 -- > .../powerpc/powerpc64/be/libpthread.abilist | 4 -- > .../powerpc/powerpc64/le/libpthread.abilist | 2 - > sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c | 61 ---------------- > sysdeps/unix/sysv/linux/s390/Versions | 2 +- > .../unix/sysv/linux/s390/libpthread-compat.c | 25 +++++++ > sysdeps/unix/sysv/linux/s390/pt-longjmp.c | 33 --------- > .../linux/s390/s390-32/libpthread.abilist | 5 +- > .../linux/s390/s390-64/libpthread.abilist | 5 +- > .../unix/sysv/linux/sh/be/libpthread.abilist | 2 - > .../unix/sysv/linux/sh/le/libpthread.abilist | 2 - > .../linux/sparc/sparc32/libpthread.abilist | 2 - > .../linux/sparc/sparc64/libpthread.abilist | 2 - > .../sysv/linux/x86_64/64/libpthread.abilist | 2 - > .../sysv/linux/x86_64/x32/libpthread.abilist | 2 - > sysdeps/x86/nptl/pt-longjmp.c | 71 ------------------- > 33 files changed, 28 insertions(+), 276 deletions(-) > delete mode 100644 nptl/pt-longjmp.c > delete mode 100644 sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c > create mode 100644 sysdeps/unix/sysv/linux/s390/libpthread-compat.c > delete mode 100644 sysdeps/unix/sysv/linux/s390/pt-longjmp.c > delete mode 100644 sysdeps/x86/nptl/pt-longjmp.c > > diff --git a/nptl/Makefile b/nptl/Makefile > index 147a8d3d59..7e566675f2 100644 > --- a/nptl/Makefile > +++ b/nptl/Makefile > @@ -116,7 +116,6 @@ libpthread-routines = \ > pt-cleanup \ > pt-fcntl \ > pt-interp \ > - pt-longjmp \ > pt-raise \ > pt-system \ > pthread_attr_getaffinity \ > diff --git a/nptl/Versions b/nptl/Versions > index ff6eae2566..cf4d5b677d 100644 > --- a/nptl/Versions > +++ b/nptl/Versions > @@ -155,7 +155,6 @@ libpthread { > fsync; > ftrylockfile; > funlockfile; > - longjmp; > lseek; > msync; > open; > @@ -205,7 +204,6 @@ libpthread { > sendmsg; > sendto; > sigaction; > - siglongjmp; > sigwait; > system; > tcdrain; > diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c > deleted file mode 100644 > index 3f903495dc..0000000000 > --- a/nptl/pt-longjmp.c > +++ /dev/null > @@ -1,49 +0,0 @@ > -/* ABI compatibility for 'longjmp' and 'siglongjmp' symbols in libpthread ABI. > - Copyright (C) 2002-2021 Free Software Foundation, Inc. > - This file is part of the GNU C Library. > - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. > - > - The GNU C Library is free software; you can redistribute it and/or > - modify it under the terms of the GNU Lesser General Public > - License as published by the Free Software Foundation; either > - version 2.1 of the License, or (at your option) any later version. > - > - The GNU C Library is distributed in the hope that it will be useful, > - but WITHOUT ANY WARRANTY; without even the implied warranty of > - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - Lesser General Public License for more details. > - > - You should have received a copy of the GNU Lesser General Public > - License along with the GNU C Library; if not, see > - <https://www.gnu.org/licenses/>. */ > - > -#include <setjmp.h> > -#include <shlib-compat.h> > - > -/* libpthread once had its own longjmp (and siglongjmp alias), though there > - was no apparent reason for it. There is no use in having a separate > - symbol in libpthread, but the historical ABI requires it. For static > - linking, there is no need to provide anything here--the libc version > - will be linked in. For shared library ABI compatibility, there must be > - longjmp and siglongjmp symbols in libpthread.so. > - > - With an IFUNC resolver, it would be possible to avoid the indirection, > - but the IFUNC resolver might run before the __libc_longjmp symbol has > - been relocated, in which case the IFUNC resolver would not be able to > - provide the correct address. */ > - > -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22) > - > -static void __attribute__ ((noreturn, used)) > -longjmp_compat (jmp_buf env, int val) > -{ > - __libc_longjmp (env, val); > -} > - > -strong_alias (longjmp_compat, longjmp_alias) > -compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0); > - > -strong_alias (longjmp_alias, siglongjmp_alias) > -compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0); > - > -#endif > diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist > index 6047fa274f..884d97efca 100644 > --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist > @@ -51,7 +51,6 @@ GLIBC_2.17 flockfile F > GLIBC_2.17 fsync F > GLIBC_2.17 ftrylockfile F > GLIBC_2.17 funlockfile F > -GLIBC_2.17 longjmp F > GLIBC_2.17 lseek F > GLIBC_2.17 lseek64 F > GLIBC_2.17 msync F > @@ -175,7 +174,6 @@ GLIBC_2.17 send F > GLIBC_2.17 sendmsg F > GLIBC_2.17 sendto F > GLIBC_2.17 sigaction F > -GLIBC_2.17 siglongjmp F > GLIBC_2.17 sigwait F > GLIBC_2.17 system F > GLIBC_2.17 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist > index 5f8c13bb69..e17b5183ef 100644 > --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist > @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F > GLIBC_2.0 fsync F > GLIBC_2.0 ftrylockfile F > GLIBC_2.0 funlockfile F > -GLIBC_2.0 longjmp F > GLIBC_2.0 lseek F > GLIBC_2.0 msync F > GLIBC_2.0 open F > @@ -81,7 +80,6 @@ GLIBC_2.0 send F > GLIBC_2.0 sendmsg F > GLIBC_2.0 sendto F > GLIBC_2.0 sigaction F > -GLIBC_2.0 siglongjmp F > GLIBC_2.0 sigwait F > GLIBC_2.0 system F > GLIBC_2.0 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist > index c2e78416b8..e75c83d47f 100644 > --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist > @@ -85,7 +85,6 @@ GLIBC_2.4 flockfile F > GLIBC_2.4 fsync F > GLIBC_2.4 ftrylockfile F > GLIBC_2.4 funlockfile F > -GLIBC_2.4 longjmp F > GLIBC_2.4 lseek F > GLIBC_2.4 lseek64 F > GLIBC_2.4 msync F > @@ -204,7 +203,6 @@ GLIBC_2.4 send F > GLIBC_2.4 sendmsg F > GLIBC_2.4 sendto F > GLIBC_2.4 sigaction F > -GLIBC_2.4 siglongjmp F > GLIBC_2.4 sigwait F > GLIBC_2.4 system F > GLIBC_2.4 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist > index c2e78416b8..e75c83d47f 100644 > --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist > @@ -85,7 +85,6 @@ GLIBC_2.4 flockfile F > GLIBC_2.4 fsync F > GLIBC_2.4 ftrylockfile F > GLIBC_2.4 funlockfile F > -GLIBC_2.4 longjmp F > GLIBC_2.4 lseek F > GLIBC_2.4 lseek64 F > GLIBC_2.4 msync F > @@ -204,7 +203,6 @@ GLIBC_2.4 send F > GLIBC_2.4 sendmsg F > GLIBC_2.4 sendto F > GLIBC_2.4 sigaction F > -GLIBC_2.4 siglongjmp F > GLIBC_2.4 sigwait F > GLIBC_2.4 system F > GLIBC_2.4 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist > index 8d7aa63a02..740570ef37 100644 > --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist > @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F > GLIBC_2.2 fsync F > GLIBC_2.2 ftrylockfile F > GLIBC_2.2 funlockfile F > -GLIBC_2.2 longjmp F > GLIBC_2.2 lseek F > GLIBC_2.2 lseek64 F > GLIBC_2.2 msync F > @@ -157,7 +156,6 @@ GLIBC_2.2 send F > GLIBC_2.2 sendmsg F > GLIBC_2.2 sendto F > GLIBC_2.2 sigaction F > -GLIBC_2.2 siglongjmp F > GLIBC_2.2 sigwait F > GLIBC_2.2 system F > GLIBC_2.2 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist > index ee156d6f49..0b8c5b9104 100644 > --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist > @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F > GLIBC_2.0 fsync F > GLIBC_2.0 ftrylockfile F > GLIBC_2.0 funlockfile F > -GLIBC_2.0 longjmp F > GLIBC_2.0 lseek F > GLIBC_2.0 msync F > GLIBC_2.0 open F > @@ -81,7 +80,6 @@ GLIBC_2.0 send F > GLIBC_2.0 sendmsg F > GLIBC_2.0 sendto F > GLIBC_2.0 sigaction F > -GLIBC_2.0 siglongjmp F > GLIBC_2.0 sigwait F > GLIBC_2.0 system F > GLIBC_2.0 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist > index ab6a5cfb78..0565c43c10 100644 > --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist > @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F > GLIBC_2.2 fsync F > GLIBC_2.2 ftrylockfile F > GLIBC_2.2 funlockfile F > -GLIBC_2.2 longjmp F > GLIBC_2.2 lseek F > GLIBC_2.2 lseek64 F > GLIBC_2.2 msync F > @@ -157,7 +156,6 @@ GLIBC_2.2 send F > GLIBC_2.2 sendmsg F > GLIBC_2.2 sendto F > GLIBC_2.2 sigaction F > -GLIBC_2.2 siglongjmp F > GLIBC_2.2 sigwait F > GLIBC_2.2 system F > GLIBC_2.2 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist > index c2e78416b8..e75c83d47f 100644 > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist > @@ -85,7 +85,6 @@ GLIBC_2.4 flockfile F > GLIBC_2.4 fsync F > GLIBC_2.4 ftrylockfile F > GLIBC_2.4 funlockfile F > -GLIBC_2.4 longjmp F > GLIBC_2.4 lseek F > GLIBC_2.4 lseek64 F > GLIBC_2.4 msync F > @@ -204,7 +203,6 @@ GLIBC_2.4 send F > GLIBC_2.4 sendmsg F > GLIBC_2.4 sendto F > GLIBC_2.4 sigaction F > -GLIBC_2.4 siglongjmp F > GLIBC_2.4 sigwait F > GLIBC_2.4 system F > GLIBC_2.4 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist > index ee156d6f49..0b8c5b9104 100644 > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist > @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F > GLIBC_2.0 fsync F > GLIBC_2.0 ftrylockfile F > GLIBC_2.0 funlockfile F > -GLIBC_2.0 longjmp F > GLIBC_2.0 lseek F > GLIBC_2.0 msync F > GLIBC_2.0 open F > @@ -81,7 +80,6 @@ GLIBC_2.0 send F > GLIBC_2.0 sendmsg F > GLIBC_2.0 sendto F > GLIBC_2.0 sigaction F > -GLIBC_2.0 siglongjmp F > GLIBC_2.0 sigwait F > GLIBC_2.0 system F > GLIBC_2.0 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist > index 1f516569ba..3798ae24be 100644 > --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist > @@ -51,7 +51,6 @@ GLIBC_2.18 flockfile F > GLIBC_2.18 fsync F > GLIBC_2.18 ftrylockfile F > GLIBC_2.18 funlockfile F > -GLIBC_2.18 longjmp F > GLIBC_2.18 lseek F > GLIBC_2.18 lseek64 F > GLIBC_2.18 msync F > @@ -177,7 +176,6 @@ GLIBC_2.18 send F > GLIBC_2.18 sendmsg F > GLIBC_2.18 sendto F > GLIBC_2.18 sigaction F > -GLIBC_2.18 siglongjmp F > GLIBC_2.18 sigwait F > GLIBC_2.18 system F > GLIBC_2.18 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist > index 1f516569ba..3798ae24be 100644 > --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist > @@ -51,7 +51,6 @@ GLIBC_2.18 flockfile F > GLIBC_2.18 fsync F > GLIBC_2.18 ftrylockfile F > GLIBC_2.18 funlockfile F > -GLIBC_2.18 longjmp F > GLIBC_2.18 lseek F > GLIBC_2.18 lseek64 F > GLIBC_2.18 msync F > @@ -177,7 +176,6 @@ GLIBC_2.18 send F > GLIBC_2.18 sendmsg F > GLIBC_2.18 sendto F > GLIBC_2.18 sigaction F > -GLIBC_2.18 siglongjmp F > GLIBC_2.18 sigwait F > GLIBC_2.18 system F > GLIBC_2.18 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist > index 903f49957f..79da59eb81 100644 > --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist > @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F > GLIBC_2.0 fsync F > GLIBC_2.0 ftrylockfile F > GLIBC_2.0 funlockfile F > -GLIBC_2.0 longjmp F > GLIBC_2.0 lseek F > GLIBC_2.0 msync F > GLIBC_2.0 open F > @@ -81,7 +80,6 @@ GLIBC_2.0 send F > GLIBC_2.0 sendmsg F > GLIBC_2.0 sendto F > GLIBC_2.0 sigaction F > -GLIBC_2.0 siglongjmp F > GLIBC_2.0 sigwait F > GLIBC_2.0 system F > GLIBC_2.0 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist > index 903f49957f..79da59eb81 100644 > --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist > @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F > GLIBC_2.0 fsync F > GLIBC_2.0 ftrylockfile F > GLIBC_2.0 funlockfile F > -GLIBC_2.0 longjmp F > GLIBC_2.0 lseek F > GLIBC_2.0 msync F > GLIBC_2.0 open F > @@ -81,7 +80,6 @@ GLIBC_2.0 send F > GLIBC_2.0 sendmsg F > GLIBC_2.0 sendto F > GLIBC_2.0 sigaction F > -GLIBC_2.0 siglongjmp F > GLIBC_2.0 sigwait F > GLIBC_2.0 system F > GLIBC_2.0 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist > index cd41c7d42b..9dadbc85cc 100644 > --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist > @@ -51,7 +51,6 @@ GLIBC_2.21 flockfile F > GLIBC_2.21 fsync F > GLIBC_2.21 ftrylockfile F > GLIBC_2.21 funlockfile F > -GLIBC_2.21 longjmp F > GLIBC_2.21 lseek F > GLIBC_2.21 lseek64 F > GLIBC_2.21 msync F > @@ -177,7 +176,6 @@ GLIBC_2.21 send F > GLIBC_2.21 sendmsg F > GLIBC_2.21 sendto F > GLIBC_2.21 sigaction F > -GLIBC_2.21 siglongjmp F > GLIBC_2.21 sigwait F > GLIBC_2.21 system F > GLIBC_2.21 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist > index 589a865796..c852fcc147 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist > @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F > GLIBC_2.0 fsync F > GLIBC_2.0 ftrylockfile F > GLIBC_2.0 funlockfile F > -GLIBC_2.0 longjmp F > GLIBC_2.0 lseek F > GLIBC_2.0 msync F > GLIBC_2.0 open F > @@ -81,7 +80,6 @@ GLIBC_2.0 send F > GLIBC_2.0 sendmsg F > GLIBC_2.0 sendto F > GLIBC_2.0 sigaction F > -GLIBC_2.0 siglongjmp F > GLIBC_2.0 sigwait F > GLIBC_2.0 system F > GLIBC_2.0 tcdrain F > @@ -209,11 +207,9 @@ GLIBC_2.3.3 pthread_condattr_setclock F > GLIBC_2.3.3 pthread_setaffinity_np F > GLIBC_2.3.3 pthread_timedjoin_np F > GLIBC_2.3.3 pthread_tryjoin_np F > -GLIBC_2.3.4 longjmp F > GLIBC_2.3.4 pthread_attr_getaffinity_np F > GLIBC_2.3.4 pthread_setaffinity_np F > GLIBC_2.3.4 pthread_setschedprio F > -GLIBC_2.3.4 siglongjmp F > GLIBC_2.30 pthread_cond_clockwait F > GLIBC_2.30 pthread_mutex_clocklock F > GLIBC_2.30 pthread_rwlock_clockrdlock F > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist > index 7c1553be29..b7d0c8b743 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist > @@ -74,7 +74,6 @@ GLIBC_2.3 flockfile F > GLIBC_2.3 fsync F > GLIBC_2.3 ftrylockfile F > GLIBC_2.3 funlockfile F > -GLIBC_2.3 longjmp F > GLIBC_2.3 lseek F > GLIBC_2.3 lseek64 F > GLIBC_2.3 msync F > @@ -177,7 +176,6 @@ GLIBC_2.3 send F > GLIBC_2.3 sendmsg F > GLIBC_2.3 sendto F > GLIBC_2.3 sigaction F > -GLIBC_2.3 siglongjmp F > GLIBC_2.3 sigwait F > GLIBC_2.3 system F > GLIBC_2.3 tcdrain F > @@ -198,11 +196,9 @@ GLIBC_2.3.3 pthread_condattr_setclock F > GLIBC_2.3.3 pthread_setaffinity_np F > GLIBC_2.3.3 pthread_timedjoin_np F > GLIBC_2.3.3 pthread_tryjoin_np F > -GLIBC_2.3.4 longjmp F > GLIBC_2.3.4 pthread_attr_getaffinity_np F > GLIBC_2.3.4 pthread_setaffinity_np F > GLIBC_2.3.4 pthread_setschedprio F > -GLIBC_2.3.4 siglongjmp F > GLIBC_2.30 pthread_cond_clockwait F > GLIBC_2.30 pthread_mutex_clocklock F > GLIBC_2.30 pthread_rwlock_clockrdlock F > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist > index 6047fa274f..884d97efca 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist > @@ -51,7 +51,6 @@ GLIBC_2.17 flockfile F > GLIBC_2.17 fsync F > GLIBC_2.17 ftrylockfile F > GLIBC_2.17 funlockfile F > -GLIBC_2.17 longjmp F > GLIBC_2.17 lseek F > GLIBC_2.17 lseek64 F > GLIBC_2.17 msync F > @@ -175,7 +174,6 @@ GLIBC_2.17 send F > GLIBC_2.17 sendmsg F > GLIBC_2.17 sendto F > GLIBC_2.17 sigaction F > -GLIBC_2.17 siglongjmp F > GLIBC_2.17 sigwait F > GLIBC_2.17 system F > GLIBC_2.17 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c b/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c > deleted file mode 100644 > index ed6b2a5db1..0000000000 > --- a/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c > +++ /dev/null > @@ -1,61 +0,0 @@ > -/* Copyright (C) 2002-2021 Free Software Foundation, Inc. > - This file is part of the GNU C Library. > - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. > - > - The GNU C Library is free software; you can redistribute it and/or > - modify it under the terms of the GNU Lesser General Public > - License as published by the Free Software Foundation; either > - version 2.1 of the License, or (at your option) any later version. > - > - The GNU C Library is distributed in the hope that it will be useful, > - but WITHOUT ANY WARRANTY; without even the implied warranty of > - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - Lesser General Public License for more details. > - > - You should have received a copy of the GNU Lesser General Public > - License along with the GNU C Library; if not, see > - <https://www.gnu.org/licenses/>. */ > - > -#include <setjmp.h> > -#include <stdlib.h> > -#include <bits/wordsize.h> > -#include "pthreadP.h" > -#include <shlib-compat.h> > -#if defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3_4) > - > -/* These functions are not declared anywhere since they shouldn't be > - used at another place but here. */ > -extern void __novmx__libc_siglongjmp (sigjmp_buf env, int val) > - __attribute__ ((noreturn)); > -extern void __novmx__libc_longjmp (sigjmp_buf env, int val) > - __attribute__ ((noreturn)); > - > - > -void __novmx_siglongjmp (sigjmp_buf env, int val) > -{ > - __novmx__libc_siglongjmp (env, val); > -} > - > -void __novmx_longjmp (jmp_buf env, int val) > -{ > - __novmx__libc_longjmp (env, val); > -} > - > -compat_symbol (libpthread, __novmx_longjmp, longjmp, GLIBC_2_0); > -compat_symbol (libpthread, __novmx_siglongjmp, siglongjmp, GLIBC_2_0); > -#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)) */ > - > -void > -__vmx_longjmp (jmp_buf env, int val) > -{ > - __libc_longjmp (env, val); > -} > - > -void > -__vmx_siglongjmp (jmp_buf env, int val) > -{ > - __libc_siglongjmp (env, val); > -} > - > -versioned_symbol (libpthread, __vmx_longjmp, longjmp, GLIBC_2_3_4); > -versioned_symbol (libpthread, __vmx_siglongjmp, siglongjmp, GLIBC_2_3_4); > diff --git a/sysdeps/unix/sysv/linux/s390/Versions b/sysdeps/unix/sysv/linux/s390/Versions > index 55518a7e5f..548397fcff 100644 > --- a/sysdeps/unix/sysv/linux/s390/Versions > +++ b/sysdeps/unix/sysv/linux/s390/Versions > @@ -11,6 +11,6 @@ libc { > > libpthread { > GLIBC_2.19 { > - longjmp; siglongjmp; > + __libpthread_version_placeholder; > } > } > diff --git a/sysdeps/unix/sysv/linux/s390/libpthread-compat.c b/sysdeps/unix/sysv/linux/s390/libpthread-compat.c > new file mode 100644 > index 0000000000..e8a7b6db5e > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/s390/libpthread-compat.c > @@ -0,0 +1,25 @@ > +/* Placeholder definitions to pull in removed symbol versions. s390 version. > + Copyright (C) 2019-2021 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + <https://www.gnu.org/licenses/>. */ > + > +#include <nptl/libpthread-compat.c> > + > +/* GLIBC_2.19 was used by a longjmp compatibility symbol. */ > +#if (SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) > +compat_symbol_unique (libpthread, > + __libpthread_version_placeholder, GLIBC_2_19); > +#endif > diff --git a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c > deleted file mode 100644 > index 6e97ed538b..0000000000 > --- a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c > +++ /dev/null > @@ -1,33 +0,0 @@ > -/* Copyright (C) 2014-2021 Free Software Foundation, Inc. > - This file is part of the GNU C Library. > - > - The GNU C Library is free software; you can redistribute it and/or > - modify it under the terms of the GNU Lesser General Public > - License as published by the Free Software Foundation; either > - version 2.1 of the License, or (at your option) any later version. > - > - The GNU C Library is distributed in the hope that it will be useful, > - but WITHOUT ANY WARRANTY; without even the implied warranty of > - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - Lesser General Public License for more details. > - > - You should have received a copy of the GNU Lesser General Public > - License along with the GNU C Library; if not, see > - <https://www.gnu.org/licenses/>. > - > - Versioned copy of nptl/pt-longjmp.c modified for versioning > - the reverted jmpbuf extension. */ > - > -#include <shlib-compat.h> > - > -#include <nptl/pt-longjmp.c> > - > -#if SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20) > -/* In glibc release 2.19 new versions of longjmp-functions were introduced, > - but were reverted before 2.20. Thus both versions are the same function. */ > - > -strong_alias (longjmp_alias, __v2longjmp) > -compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19); > -strong_alias (siglongjmp_alias, __v2siglongjmp) > -compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19); > -#endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */ > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist > index 7aa725ccae..518a08ad1e 100644 > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist > @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F > GLIBC_2.0 fsync F > GLIBC_2.0 ftrylockfile F > GLIBC_2.0 funlockfile F > -GLIBC_2.0 longjmp F > GLIBC_2.0 lseek F > GLIBC_2.0 msync F > GLIBC_2.0 open F > @@ -81,7 +80,6 @@ GLIBC_2.0 send F > GLIBC_2.0 sendmsg F > GLIBC_2.0 sendto F > GLIBC_2.0 sigaction F > -GLIBC_2.0 siglongjmp F > GLIBC_2.0 sigwait F > GLIBC_2.0 system F > GLIBC_2.0 tcdrain F > @@ -130,8 +128,7 @@ GLIBC_2.12 pthread_mutexattr_setrobust F > GLIBC_2.12 pthread_setname_np F > GLIBC_2.18 pthread_getattr_default_np F > GLIBC_2.18 pthread_setattr_default_np F > -GLIBC_2.19 longjmp F > -GLIBC_2.19 siglongjmp F > +GLIBC_2.19 __libpthread_version_placeholder F > GLIBC_2.2 __open64 F > GLIBC_2.2 __pread64 F > GLIBC_2.2 __pthread_rwlock_destroy F > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist > index 25da7ea8dc..c21f7cfea6 100644 > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist > @@ -5,8 +5,7 @@ GLIBC_2.12 pthread_mutexattr_setrobust F > GLIBC_2.12 pthread_setname_np F > GLIBC_2.18 pthread_getattr_default_np F > GLIBC_2.18 pthread_setattr_default_np F > -GLIBC_2.19 longjmp F > -GLIBC_2.19 siglongjmp F > +GLIBC_2.19 __libpthread_version_placeholder F > GLIBC_2.2 _IO_flockfile F > GLIBC_2.2 _IO_ftrylockfile F > GLIBC_2.2 _IO_funlockfile F > @@ -55,7 +54,6 @@ GLIBC_2.2 flockfile F > GLIBC_2.2 fsync F > GLIBC_2.2 ftrylockfile F > GLIBC_2.2 funlockfile F > -GLIBC_2.2 longjmp F > GLIBC_2.2 lseek F > GLIBC_2.2 lseek64 F > GLIBC_2.2 msync F > @@ -159,7 +157,6 @@ GLIBC_2.2 send F > GLIBC_2.2 sendmsg F > GLIBC_2.2 sendto F > GLIBC_2.2 sigaction F > -GLIBC_2.2 siglongjmp F > GLIBC_2.2 sigwait F > GLIBC_2.2 system F > GLIBC_2.2 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist > index 8d7aa63a02..740570ef37 100644 > --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist > @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F > GLIBC_2.2 fsync F > GLIBC_2.2 ftrylockfile F > GLIBC_2.2 funlockfile F > -GLIBC_2.2 longjmp F > GLIBC_2.2 lseek F > GLIBC_2.2 lseek64 F > GLIBC_2.2 msync F > @@ -157,7 +156,6 @@ GLIBC_2.2 send F > GLIBC_2.2 sendmsg F > GLIBC_2.2 sendto F > GLIBC_2.2 sigaction F > -GLIBC_2.2 siglongjmp F > GLIBC_2.2 sigwait F > GLIBC_2.2 system F > GLIBC_2.2 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist > index 8d7aa63a02..740570ef37 100644 > --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist > @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F > GLIBC_2.2 fsync F > GLIBC_2.2 ftrylockfile F > GLIBC_2.2 funlockfile F > -GLIBC_2.2 longjmp F > GLIBC_2.2 lseek F > GLIBC_2.2 lseek64 F > GLIBC_2.2 msync F > @@ -157,7 +156,6 @@ GLIBC_2.2 send F > GLIBC_2.2 sendmsg F > GLIBC_2.2 sendto F > GLIBC_2.2 sigaction F > -GLIBC_2.2 siglongjmp F > GLIBC_2.2 sigwait F > GLIBC_2.2 system F > GLIBC_2.2 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist > index 5f8c13bb69..e17b5183ef 100644 > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist > @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F > GLIBC_2.0 fsync F > GLIBC_2.0 ftrylockfile F > GLIBC_2.0 funlockfile F > -GLIBC_2.0 longjmp F > GLIBC_2.0 lseek F > GLIBC_2.0 msync F > GLIBC_2.0 open F > @@ -81,7 +80,6 @@ GLIBC_2.0 send F > GLIBC_2.0 sendmsg F > GLIBC_2.0 sendto F > GLIBC_2.0 sigaction F > -GLIBC_2.0 siglongjmp F > GLIBC_2.0 sigwait F > GLIBC_2.0 system F > GLIBC_2.0 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist > index ab6a5cfb78..0565c43c10 100644 > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist > @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F > GLIBC_2.2 fsync F > GLIBC_2.2 ftrylockfile F > GLIBC_2.2 funlockfile F > -GLIBC_2.2 longjmp F > GLIBC_2.2 lseek F > GLIBC_2.2 lseek64 F > GLIBC_2.2 msync F > @@ -157,7 +156,6 @@ GLIBC_2.2 send F > GLIBC_2.2 sendmsg F > GLIBC_2.2 sendto F > GLIBC_2.2 sigaction F > -GLIBC_2.2 siglongjmp F > GLIBC_2.2 sigwait F > GLIBC_2.2 system F > GLIBC_2.2 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist > index 301c0817b8..f1255816b1 100644 > --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist > @@ -53,7 +53,6 @@ GLIBC_2.2.5 flockfile F > GLIBC_2.2.5 fsync F > GLIBC_2.2.5 ftrylockfile F > GLIBC_2.2.5 funlockfile F > -GLIBC_2.2.5 longjmp F > GLIBC_2.2.5 lseek F > GLIBC_2.2.5 lseek64 F > GLIBC_2.2.5 msync F > @@ -157,7 +156,6 @@ GLIBC_2.2.5 send F > GLIBC_2.2.5 sendmsg F > GLIBC_2.2.5 sendto F > GLIBC_2.2.5 sigaction F > -GLIBC_2.2.5 siglongjmp F > GLIBC_2.2.5 sigwait F > GLIBC_2.2.5 system F > GLIBC_2.2.5 tcdrain F > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist > index 31322dfabb..fdaff69ea6 100644 > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist > @@ -51,7 +51,6 @@ GLIBC_2.16 flockfile F > GLIBC_2.16 fsync F > GLIBC_2.16 ftrylockfile F > GLIBC_2.16 funlockfile F > -GLIBC_2.16 longjmp F > GLIBC_2.16 lseek F > GLIBC_2.16 lseek64 F > GLIBC_2.16 msync F > @@ -175,7 +174,6 @@ GLIBC_2.16 send F > GLIBC_2.16 sendmsg F > GLIBC_2.16 sendto F > GLIBC_2.16 sigaction F > -GLIBC_2.16 siglongjmp F > GLIBC_2.16 sigwait F > GLIBC_2.16 system F > GLIBC_2.16 tcdrain F > diff --git a/sysdeps/x86/nptl/pt-longjmp.c b/sysdeps/x86/nptl/pt-longjmp.c > deleted file mode 100644 > index 77b32667ee..0000000000 > --- a/sysdeps/x86/nptl/pt-longjmp.c > +++ /dev/null > @@ -1,71 +0,0 @@ > -/* ABI compatibility for 'longjmp' and 'siglongjmp' symbols in libpthread ABI. > - X86 version. > - Copyright (C) 1918-2021 Free Software Foundation, Inc. > - This file is part of the GNU C Library. > - > - The GNU C Library is free software; you can redistribute it and/or > - modify it under the terms of the GNU Lesser General Public > - License as published by the Free Software Foundation; either > - version 2.1 of the License, or (at your option) any later version. > - > - The GNU C Library is distributed in the hope that it will be useful, > - but WITHOUT ANY WARRANTY; without even the implied warranty of > - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - Lesser General Public License for more details. > - > - You should have received a copy of the GNU Lesser General Public > - License along with the GNU C Library; if not, see > - <https://www.gnu.org/licenses/>. */ > - > -#include <pthreadP.h> > -#include <jmp_buf-ssp.h> > - > -#ifdef __x86_64__ > -# define SHADOW_STACK_POINTER_SIZE 8 > -#else > -# define SHADOW_STACK_POINTER_SIZE 4 > -#endif > - > -/* Assert that the priv field in struct pthread_unwind_buf has space > - to store shadow stack pointer. */ > -_Static_assert ((offsetof (struct pthread_unwind_buf, priv) > - <= SHADOW_STACK_POINTER_OFFSET) > - && ((offsetof (struct pthread_unwind_buf, priv) > - + sizeof (((struct pthread_unwind_buf *) 0)->priv)) > - >= (SHADOW_STACK_POINTER_OFFSET > - + SHADOW_STACK_POINTER_SIZE)), > - "Shadow stack pointer is not within private storage " > - "of pthread_unwind_buf."); > - > -#include <shlib-compat.h> > - > -/* libpthread once had its own longjmp (and siglongjmp alias), though there > - was no apparent reason for it. There is no use in having a separate > - symbol in libpthread, but the historical ABI requires it. For static > - linking, there is no need to provide anything here--the libc version > - will be linked in. For shared library ABI compatibility, there must be > - longjmp and siglongjmp symbols in libpthread.so. > - > - With an IFUNC resolver, it would be possible to avoid the indirection, > - but the IFUNC resolver might run before the __libc_longjmp symbol has > - been relocated, in which case the IFUNC resolver would not be able to > - provide the correct address. */ > - > -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22) > - > -static void __attribute__ ((noreturn, used)) > -longjmp_compat (jmp_buf env, int val) > -{ > - /* NB: We call __libc_siglongjmp, instead of __libc_longjmp, since > - __libc_longjmp is a private interface for cancellation which > - doesn't restore shadow stack register. */ > - __libc_siglongjmp (env, val); > -} > - > -strong_alias (longjmp_compat, longjmp_alias) > -compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0); > - > -strong_alias (longjmp_alias, siglongjmp_alias) > -compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0); > - > -#endif >
* Adhemerval Zanella: > On 12/03/2021 14:49, Florian Weimer via Libc-alpha wrote: >> The definitions in libc are sufficient, the forwarders are no longer >> needed. >> >> The symbols have been moved using scripts/move-symbol-to-libc.py. >> s390-linux-gnu and s390x-linux-gnu need a new version placeholder >> to keep the GLIBC_2.19 symbol version in libpthread. >> >> Tested on i386-linux-gnu, powerpc64le-linux-gnu, s390x-linux-gnu, >> x86_64-linux-gnu. Built with build-many-glibcs.py. > > Patch looks good, I was working on a similar one as well. The only > suggestion is to keep the x86 _Static_assert regarding the priv field > in struct pthread_unwind_buf has space to store shadow stack pointer. > > I have done it by adding a new x86 longjmp implementation: > > diff --git a/sysdeps/unix/sysv/linux/x86/longjmp.c b/sysdeps/unix/sysv/linux/x86/longjmp.c > new file mode 100644 > index 0000000000..104592fd48 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/x86/longjmp.c > @@ -0,0 +1,39 @@ > +/* __libc_siglongjmp for Linux/x86 > + Copyright (C) 2021 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + <https://www.gnu.org/licenses/>. */ > + > +#include <sysdeps/x86/longjmp.c> > + > +#include <nptl/pthreadP.h> > +#include <jmp_buf-ssp.h> > + > +#ifdef __x86_64__ > +# define SHADOW_STACK_POINTER_SIZE 8 > +#else > +# define SHADOW_STACK_POINTER_SIZE 4 > +#endif > + > +/* Assert that the priv field in struct pthread_unwind_buf has space > + to store shadow stack pointer. */ > +_Static_assert ((offsetof (struct pthread_unwind_buf, priv) > + <= SHADOW_STACK_POINTER_OFFSET) > + && ((offsetof (struct pthread_unwind_buf, priv) > + + sizeof (((struct pthread_unwind_buf *) 0)->priv)) > + >= (SHADOW_STACK_POINTER_OFFSET > + + SHADOW_STACK_POINTER_SIZE)), > + "Shadow stack pointer is not within private storage " > + "of pthread_unwind_buf."); Thanks, I've merged this into the series. Florian
diff --git a/nptl/Makefile b/nptl/Makefile index 147a8d3d59..7e566675f2 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -116,7 +116,6 @@ libpthread-routines = \ pt-cleanup \ pt-fcntl \ pt-interp \ - pt-longjmp \ pt-raise \ pt-system \ pthread_attr_getaffinity \ diff --git a/nptl/Versions b/nptl/Versions index ff6eae2566..cf4d5b677d 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -155,7 +155,6 @@ libpthread { fsync; ftrylockfile; funlockfile; - longjmp; lseek; msync; open; @@ -205,7 +204,6 @@ libpthread { sendmsg; sendto; sigaction; - siglongjmp; sigwait; system; tcdrain; diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c deleted file mode 100644 index 3f903495dc..0000000000 --- a/nptl/pt-longjmp.c +++ /dev/null @@ -1,49 +0,0 @@ -/* ABI compatibility for 'longjmp' and 'siglongjmp' symbols in libpthread ABI. - Copyright (C) 2002-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <setjmp.h> -#include <shlib-compat.h> - -/* libpthread once had its own longjmp (and siglongjmp alias), though there - was no apparent reason for it. There is no use in having a separate - symbol in libpthread, but the historical ABI requires it. For static - linking, there is no need to provide anything here--the libc version - will be linked in. For shared library ABI compatibility, there must be - longjmp and siglongjmp symbols in libpthread.so. - - With an IFUNC resolver, it would be possible to avoid the indirection, - but the IFUNC resolver might run before the __libc_longjmp symbol has - been relocated, in which case the IFUNC resolver would not be able to - provide the correct address. */ - -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22) - -static void __attribute__ ((noreturn, used)) -longjmp_compat (jmp_buf env, int val) -{ - __libc_longjmp (env, val); -} - -strong_alias (longjmp_compat, longjmp_alias) -compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0); - -strong_alias (longjmp_alias, siglongjmp_alias) -compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0); - -#endif diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist index 6047fa274f..884d97efca 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist @@ -51,7 +51,6 @@ GLIBC_2.17 flockfile F GLIBC_2.17 fsync F GLIBC_2.17 ftrylockfile F GLIBC_2.17 funlockfile F -GLIBC_2.17 longjmp F GLIBC_2.17 lseek F GLIBC_2.17 lseek64 F GLIBC_2.17 msync F @@ -175,7 +174,6 @@ GLIBC_2.17 send F GLIBC_2.17 sendmsg F GLIBC_2.17 sendto F GLIBC_2.17 sigaction F -GLIBC_2.17 siglongjmp F GLIBC_2.17 sigwait F GLIBC_2.17 system F GLIBC_2.17 tcdrain F diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist index 5f8c13bb69..e17b5183ef 100644 --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F GLIBC_2.0 fsync F GLIBC_2.0 ftrylockfile F GLIBC_2.0 funlockfile F -GLIBC_2.0 longjmp F GLIBC_2.0 lseek F GLIBC_2.0 msync F GLIBC_2.0 open F @@ -81,7 +80,6 @@ GLIBC_2.0 send F GLIBC_2.0 sendmsg F GLIBC_2.0 sendto F GLIBC_2.0 sigaction F -GLIBC_2.0 siglongjmp F GLIBC_2.0 sigwait F GLIBC_2.0 system F GLIBC_2.0 tcdrain F diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist index c2e78416b8..e75c83d47f 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist @@ -85,7 +85,6 @@ GLIBC_2.4 flockfile F GLIBC_2.4 fsync F GLIBC_2.4 ftrylockfile F GLIBC_2.4 funlockfile F -GLIBC_2.4 longjmp F GLIBC_2.4 lseek F GLIBC_2.4 lseek64 F GLIBC_2.4 msync F @@ -204,7 +203,6 @@ GLIBC_2.4 send F GLIBC_2.4 sendmsg F GLIBC_2.4 sendto F GLIBC_2.4 sigaction F -GLIBC_2.4 siglongjmp F GLIBC_2.4 sigwait F GLIBC_2.4 system F GLIBC_2.4 tcdrain F diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist index c2e78416b8..e75c83d47f 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist @@ -85,7 +85,6 @@ GLIBC_2.4 flockfile F GLIBC_2.4 fsync F GLIBC_2.4 ftrylockfile F GLIBC_2.4 funlockfile F -GLIBC_2.4 longjmp F GLIBC_2.4 lseek F GLIBC_2.4 lseek64 F GLIBC_2.4 msync F @@ -204,7 +203,6 @@ GLIBC_2.4 send F GLIBC_2.4 sendmsg F GLIBC_2.4 sendto F GLIBC_2.4 sigaction F -GLIBC_2.4 siglongjmp F GLIBC_2.4 sigwait F GLIBC_2.4 system F GLIBC_2.4 tcdrain F diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist index 8d7aa63a02..740570ef37 100644 --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F GLIBC_2.2 fsync F GLIBC_2.2 ftrylockfile F GLIBC_2.2 funlockfile F -GLIBC_2.2 longjmp F GLIBC_2.2 lseek F GLIBC_2.2 lseek64 F GLIBC_2.2 msync F @@ -157,7 +156,6 @@ GLIBC_2.2 send F GLIBC_2.2 sendmsg F GLIBC_2.2 sendto F GLIBC_2.2 sigaction F -GLIBC_2.2 siglongjmp F GLIBC_2.2 sigwait F GLIBC_2.2 system F GLIBC_2.2 tcdrain F diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist index ee156d6f49..0b8c5b9104 100644 --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F GLIBC_2.0 fsync F GLIBC_2.0 ftrylockfile F GLIBC_2.0 funlockfile F -GLIBC_2.0 longjmp F GLIBC_2.0 lseek F GLIBC_2.0 msync F GLIBC_2.0 open F @@ -81,7 +80,6 @@ GLIBC_2.0 send F GLIBC_2.0 sendmsg F GLIBC_2.0 sendto F GLIBC_2.0 sigaction F -GLIBC_2.0 siglongjmp F GLIBC_2.0 sigwait F GLIBC_2.0 system F GLIBC_2.0 tcdrain F diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist index ab6a5cfb78..0565c43c10 100644 --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F GLIBC_2.2 fsync F GLIBC_2.2 ftrylockfile F GLIBC_2.2 funlockfile F -GLIBC_2.2 longjmp F GLIBC_2.2 lseek F GLIBC_2.2 lseek64 F GLIBC_2.2 msync F @@ -157,7 +156,6 @@ GLIBC_2.2 send F GLIBC_2.2 sendmsg F GLIBC_2.2 sendto F GLIBC_2.2 sigaction F -GLIBC_2.2 siglongjmp F GLIBC_2.2 sigwait F GLIBC_2.2 system F GLIBC_2.2 tcdrain F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist index c2e78416b8..e75c83d47f 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist @@ -85,7 +85,6 @@ GLIBC_2.4 flockfile F GLIBC_2.4 fsync F GLIBC_2.4 ftrylockfile F GLIBC_2.4 funlockfile F -GLIBC_2.4 longjmp F GLIBC_2.4 lseek F GLIBC_2.4 lseek64 F GLIBC_2.4 msync F @@ -204,7 +203,6 @@ GLIBC_2.4 send F GLIBC_2.4 sendmsg F GLIBC_2.4 sendto F GLIBC_2.4 sigaction F -GLIBC_2.4 siglongjmp F GLIBC_2.4 sigwait F GLIBC_2.4 system F GLIBC_2.4 tcdrain F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist index ee156d6f49..0b8c5b9104 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F GLIBC_2.0 fsync F GLIBC_2.0 ftrylockfile F GLIBC_2.0 funlockfile F -GLIBC_2.0 longjmp F GLIBC_2.0 lseek F GLIBC_2.0 msync F GLIBC_2.0 open F @@ -81,7 +80,6 @@ GLIBC_2.0 send F GLIBC_2.0 sendmsg F GLIBC_2.0 sendto F GLIBC_2.0 sigaction F -GLIBC_2.0 siglongjmp F GLIBC_2.0 sigwait F GLIBC_2.0 system F GLIBC_2.0 tcdrain F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist index 1f516569ba..3798ae24be 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist @@ -51,7 +51,6 @@ GLIBC_2.18 flockfile F GLIBC_2.18 fsync F GLIBC_2.18 ftrylockfile F GLIBC_2.18 funlockfile F -GLIBC_2.18 longjmp F GLIBC_2.18 lseek F GLIBC_2.18 lseek64 F GLIBC_2.18 msync F @@ -177,7 +176,6 @@ GLIBC_2.18 send F GLIBC_2.18 sendmsg F GLIBC_2.18 sendto F GLIBC_2.18 sigaction F -GLIBC_2.18 siglongjmp F GLIBC_2.18 sigwait F GLIBC_2.18 system F GLIBC_2.18 tcdrain F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist index 1f516569ba..3798ae24be 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist @@ -51,7 +51,6 @@ GLIBC_2.18 flockfile F GLIBC_2.18 fsync F GLIBC_2.18 ftrylockfile F GLIBC_2.18 funlockfile F -GLIBC_2.18 longjmp F GLIBC_2.18 lseek F GLIBC_2.18 lseek64 F GLIBC_2.18 msync F @@ -177,7 +176,6 @@ GLIBC_2.18 send F GLIBC_2.18 sendmsg F GLIBC_2.18 sendto F GLIBC_2.18 sigaction F -GLIBC_2.18 siglongjmp F GLIBC_2.18 sigwait F GLIBC_2.18 system F GLIBC_2.18 tcdrain F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist index 903f49957f..79da59eb81 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F GLIBC_2.0 fsync F GLIBC_2.0 ftrylockfile F GLIBC_2.0 funlockfile F -GLIBC_2.0 longjmp F GLIBC_2.0 lseek F GLIBC_2.0 msync F GLIBC_2.0 open F @@ -81,7 +80,6 @@ GLIBC_2.0 send F GLIBC_2.0 sendmsg F GLIBC_2.0 sendto F GLIBC_2.0 sigaction F -GLIBC_2.0 siglongjmp F GLIBC_2.0 sigwait F GLIBC_2.0 system F GLIBC_2.0 tcdrain F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist index 903f49957f..79da59eb81 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F GLIBC_2.0 fsync F GLIBC_2.0 ftrylockfile F GLIBC_2.0 funlockfile F -GLIBC_2.0 longjmp F GLIBC_2.0 lseek F GLIBC_2.0 msync F GLIBC_2.0 open F @@ -81,7 +80,6 @@ GLIBC_2.0 send F GLIBC_2.0 sendmsg F GLIBC_2.0 sendto F GLIBC_2.0 sigaction F -GLIBC_2.0 siglongjmp F GLIBC_2.0 sigwait F GLIBC_2.0 system F GLIBC_2.0 tcdrain F diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist index cd41c7d42b..9dadbc85cc 100644 --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist @@ -51,7 +51,6 @@ GLIBC_2.21 flockfile F GLIBC_2.21 fsync F GLIBC_2.21 ftrylockfile F GLIBC_2.21 funlockfile F -GLIBC_2.21 longjmp F GLIBC_2.21 lseek F GLIBC_2.21 lseek64 F GLIBC_2.21 msync F @@ -177,7 +176,6 @@ GLIBC_2.21 send F GLIBC_2.21 sendmsg F GLIBC_2.21 sendto F GLIBC_2.21 sigaction F -GLIBC_2.21 siglongjmp F GLIBC_2.21 sigwait F GLIBC_2.21 system F GLIBC_2.21 tcdrain F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist index 589a865796..c852fcc147 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F GLIBC_2.0 fsync F GLIBC_2.0 ftrylockfile F GLIBC_2.0 funlockfile F -GLIBC_2.0 longjmp F GLIBC_2.0 lseek F GLIBC_2.0 msync F GLIBC_2.0 open F @@ -81,7 +80,6 @@ GLIBC_2.0 send F GLIBC_2.0 sendmsg F GLIBC_2.0 sendto F GLIBC_2.0 sigaction F -GLIBC_2.0 siglongjmp F GLIBC_2.0 sigwait F GLIBC_2.0 system F GLIBC_2.0 tcdrain F @@ -209,11 +207,9 @@ GLIBC_2.3.3 pthread_condattr_setclock F GLIBC_2.3.3 pthread_setaffinity_np F GLIBC_2.3.3 pthread_timedjoin_np F GLIBC_2.3.3 pthread_tryjoin_np F -GLIBC_2.3.4 longjmp F GLIBC_2.3.4 pthread_attr_getaffinity_np F GLIBC_2.3.4 pthread_setaffinity_np F GLIBC_2.3.4 pthread_setschedprio F -GLIBC_2.3.4 siglongjmp F GLIBC_2.30 pthread_cond_clockwait F GLIBC_2.30 pthread_mutex_clocklock F GLIBC_2.30 pthread_rwlock_clockrdlock F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist index 7c1553be29..b7d0c8b743 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist @@ -74,7 +74,6 @@ GLIBC_2.3 flockfile F GLIBC_2.3 fsync F GLIBC_2.3 ftrylockfile F GLIBC_2.3 funlockfile F -GLIBC_2.3 longjmp F GLIBC_2.3 lseek F GLIBC_2.3 lseek64 F GLIBC_2.3 msync F @@ -177,7 +176,6 @@ GLIBC_2.3 send F GLIBC_2.3 sendmsg F GLIBC_2.3 sendto F GLIBC_2.3 sigaction F -GLIBC_2.3 siglongjmp F GLIBC_2.3 sigwait F GLIBC_2.3 system F GLIBC_2.3 tcdrain F @@ -198,11 +196,9 @@ GLIBC_2.3.3 pthread_condattr_setclock F GLIBC_2.3.3 pthread_setaffinity_np F GLIBC_2.3.3 pthread_timedjoin_np F GLIBC_2.3.3 pthread_tryjoin_np F -GLIBC_2.3.4 longjmp F GLIBC_2.3.4 pthread_attr_getaffinity_np F GLIBC_2.3.4 pthread_setaffinity_np F GLIBC_2.3.4 pthread_setschedprio F -GLIBC_2.3.4 siglongjmp F GLIBC_2.30 pthread_cond_clockwait F GLIBC_2.30 pthread_mutex_clocklock F GLIBC_2.30 pthread_rwlock_clockrdlock F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist index 6047fa274f..884d97efca 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist @@ -51,7 +51,6 @@ GLIBC_2.17 flockfile F GLIBC_2.17 fsync F GLIBC_2.17 ftrylockfile F GLIBC_2.17 funlockfile F -GLIBC_2.17 longjmp F GLIBC_2.17 lseek F GLIBC_2.17 lseek64 F GLIBC_2.17 msync F @@ -175,7 +174,6 @@ GLIBC_2.17 send F GLIBC_2.17 sendmsg F GLIBC_2.17 sendto F GLIBC_2.17 sigaction F -GLIBC_2.17 siglongjmp F GLIBC_2.17 sigwait F GLIBC_2.17 system F GLIBC_2.17 tcdrain F diff --git a/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c b/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c deleted file mode 100644 index ed6b2a5db1..0000000000 --- a/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 2002-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <setjmp.h> -#include <stdlib.h> -#include <bits/wordsize.h> -#include "pthreadP.h" -#include <shlib-compat.h> -#if defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3_4) - -/* These functions are not declared anywhere since they shouldn't be - used at another place but here. */ -extern void __novmx__libc_siglongjmp (sigjmp_buf env, int val) - __attribute__ ((noreturn)); -extern void __novmx__libc_longjmp (sigjmp_buf env, int val) - __attribute__ ((noreturn)); - - -void __novmx_siglongjmp (sigjmp_buf env, int val) -{ - __novmx__libc_siglongjmp (env, val); -} - -void __novmx_longjmp (jmp_buf env, int val) -{ - __novmx__libc_longjmp (env, val); -} - -compat_symbol (libpthread, __novmx_longjmp, longjmp, GLIBC_2_0); -compat_symbol (libpthread, __novmx_siglongjmp, siglongjmp, GLIBC_2_0); -#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)) */ - -void -__vmx_longjmp (jmp_buf env, int val) -{ - __libc_longjmp (env, val); -} - -void -__vmx_siglongjmp (jmp_buf env, int val) -{ - __libc_siglongjmp (env, val); -} - -versioned_symbol (libpthread, __vmx_longjmp, longjmp, GLIBC_2_3_4); -versioned_symbol (libpthread, __vmx_siglongjmp, siglongjmp, GLIBC_2_3_4); diff --git a/sysdeps/unix/sysv/linux/s390/Versions b/sysdeps/unix/sysv/linux/s390/Versions index 55518a7e5f..548397fcff 100644 --- a/sysdeps/unix/sysv/linux/s390/Versions +++ b/sysdeps/unix/sysv/linux/s390/Versions @@ -11,6 +11,6 @@ libc { libpthread { GLIBC_2.19 { - longjmp; siglongjmp; + __libpthread_version_placeholder; } } diff --git a/sysdeps/unix/sysv/linux/s390/libpthread-compat.c b/sysdeps/unix/sysv/linux/s390/libpthread-compat.c new file mode 100644 index 0000000000..e8a7b6db5e --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/libpthread-compat.c @@ -0,0 +1,25 @@ +/* Placeholder definitions to pull in removed symbol versions. s390 version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <nptl/libpthread-compat.c> + +/* GLIBC_2.19 was used by a longjmp compatibility symbol. */ +#if (SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) +compat_symbol_unique (libpthread, + __libpthread_version_placeholder, GLIBC_2_19); +#endif diff --git a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c deleted file mode 100644 index 6e97ed538b..0000000000 --- a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2014-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. - - Versioned copy of nptl/pt-longjmp.c modified for versioning - the reverted jmpbuf extension. */ - -#include <shlib-compat.h> - -#include <nptl/pt-longjmp.c> - -#if SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20) -/* In glibc release 2.19 new versions of longjmp-functions were introduced, - but were reverted before 2.20. Thus both versions are the same function. */ - -strong_alias (longjmp_alias, __v2longjmp) -compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19); -strong_alias (siglongjmp_alias, __v2siglongjmp) -compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19); -#endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist index 7aa725ccae..518a08ad1e 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F GLIBC_2.0 fsync F GLIBC_2.0 ftrylockfile F GLIBC_2.0 funlockfile F -GLIBC_2.0 longjmp F GLIBC_2.0 lseek F GLIBC_2.0 msync F GLIBC_2.0 open F @@ -81,7 +80,6 @@ GLIBC_2.0 send F GLIBC_2.0 sendmsg F GLIBC_2.0 sendto F GLIBC_2.0 sigaction F -GLIBC_2.0 siglongjmp F GLIBC_2.0 sigwait F GLIBC_2.0 system F GLIBC_2.0 tcdrain F @@ -130,8 +128,7 @@ GLIBC_2.12 pthread_mutexattr_setrobust F GLIBC_2.12 pthread_setname_np F GLIBC_2.18 pthread_getattr_default_np F GLIBC_2.18 pthread_setattr_default_np F -GLIBC_2.19 longjmp F -GLIBC_2.19 siglongjmp F +GLIBC_2.19 __libpthread_version_placeholder F GLIBC_2.2 __open64 F GLIBC_2.2 __pread64 F GLIBC_2.2 __pthread_rwlock_destroy F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist index 25da7ea8dc..c21f7cfea6 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist @@ -5,8 +5,7 @@ GLIBC_2.12 pthread_mutexattr_setrobust F GLIBC_2.12 pthread_setname_np F GLIBC_2.18 pthread_getattr_default_np F GLIBC_2.18 pthread_setattr_default_np F -GLIBC_2.19 longjmp F -GLIBC_2.19 siglongjmp F +GLIBC_2.19 __libpthread_version_placeholder F GLIBC_2.2 _IO_flockfile F GLIBC_2.2 _IO_ftrylockfile F GLIBC_2.2 _IO_funlockfile F @@ -55,7 +54,6 @@ GLIBC_2.2 flockfile F GLIBC_2.2 fsync F GLIBC_2.2 ftrylockfile F GLIBC_2.2 funlockfile F -GLIBC_2.2 longjmp F GLIBC_2.2 lseek F GLIBC_2.2 lseek64 F GLIBC_2.2 msync F @@ -159,7 +157,6 @@ GLIBC_2.2 send F GLIBC_2.2 sendmsg F GLIBC_2.2 sendto F GLIBC_2.2 sigaction F -GLIBC_2.2 siglongjmp F GLIBC_2.2 sigwait F GLIBC_2.2 system F GLIBC_2.2 tcdrain F diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist index 8d7aa63a02..740570ef37 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F GLIBC_2.2 fsync F GLIBC_2.2 ftrylockfile F GLIBC_2.2 funlockfile F -GLIBC_2.2 longjmp F GLIBC_2.2 lseek F GLIBC_2.2 lseek64 F GLIBC_2.2 msync F @@ -157,7 +156,6 @@ GLIBC_2.2 send F GLIBC_2.2 sendmsg F GLIBC_2.2 sendto F GLIBC_2.2 sigaction F -GLIBC_2.2 siglongjmp F GLIBC_2.2 sigwait F GLIBC_2.2 system F GLIBC_2.2 tcdrain F diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist index 8d7aa63a02..740570ef37 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F GLIBC_2.2 fsync F GLIBC_2.2 ftrylockfile F GLIBC_2.2 funlockfile F -GLIBC_2.2 longjmp F GLIBC_2.2 lseek F GLIBC_2.2 lseek64 F GLIBC_2.2 msync F @@ -157,7 +156,6 @@ GLIBC_2.2 send F GLIBC_2.2 sendmsg F GLIBC_2.2 sendto F GLIBC_2.2 sigaction F -GLIBC_2.2 siglongjmp F GLIBC_2.2 sigwait F GLIBC_2.2 system F GLIBC_2.2 tcdrain F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist index 5f8c13bb69..e17b5183ef 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist @@ -32,7 +32,6 @@ GLIBC_2.0 flockfile F GLIBC_2.0 fsync F GLIBC_2.0 ftrylockfile F GLIBC_2.0 funlockfile F -GLIBC_2.0 longjmp F GLIBC_2.0 lseek F GLIBC_2.0 msync F GLIBC_2.0 open F @@ -81,7 +80,6 @@ GLIBC_2.0 send F GLIBC_2.0 sendmsg F GLIBC_2.0 sendto F GLIBC_2.0 sigaction F -GLIBC_2.0 siglongjmp F GLIBC_2.0 sigwait F GLIBC_2.0 system F GLIBC_2.0 tcdrain F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist index ab6a5cfb78..0565c43c10 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist @@ -53,7 +53,6 @@ GLIBC_2.2 flockfile F GLIBC_2.2 fsync F GLIBC_2.2 ftrylockfile F GLIBC_2.2 funlockfile F -GLIBC_2.2 longjmp F GLIBC_2.2 lseek F GLIBC_2.2 lseek64 F GLIBC_2.2 msync F @@ -157,7 +156,6 @@ GLIBC_2.2 send F GLIBC_2.2 sendmsg F GLIBC_2.2 sendto F GLIBC_2.2 sigaction F -GLIBC_2.2 siglongjmp F GLIBC_2.2 sigwait F GLIBC_2.2 system F GLIBC_2.2 tcdrain F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist index 301c0817b8..f1255816b1 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist @@ -53,7 +53,6 @@ GLIBC_2.2.5 flockfile F GLIBC_2.2.5 fsync F GLIBC_2.2.5 ftrylockfile F GLIBC_2.2.5 funlockfile F -GLIBC_2.2.5 longjmp F GLIBC_2.2.5 lseek F GLIBC_2.2.5 lseek64 F GLIBC_2.2.5 msync F @@ -157,7 +156,6 @@ GLIBC_2.2.5 send F GLIBC_2.2.5 sendmsg F GLIBC_2.2.5 sendto F GLIBC_2.2.5 sigaction F -GLIBC_2.2.5 siglongjmp F GLIBC_2.2.5 sigwait F GLIBC_2.2.5 system F GLIBC_2.2.5 tcdrain F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist index 31322dfabb..fdaff69ea6 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist @@ -51,7 +51,6 @@ GLIBC_2.16 flockfile F GLIBC_2.16 fsync F GLIBC_2.16 ftrylockfile F GLIBC_2.16 funlockfile F -GLIBC_2.16 longjmp F GLIBC_2.16 lseek F GLIBC_2.16 lseek64 F GLIBC_2.16 msync F @@ -175,7 +174,6 @@ GLIBC_2.16 send F GLIBC_2.16 sendmsg F GLIBC_2.16 sendto F GLIBC_2.16 sigaction F -GLIBC_2.16 siglongjmp F GLIBC_2.16 sigwait F GLIBC_2.16 system F GLIBC_2.16 tcdrain F diff --git a/sysdeps/x86/nptl/pt-longjmp.c b/sysdeps/x86/nptl/pt-longjmp.c deleted file mode 100644 index 77b32667ee..0000000000 --- a/sysdeps/x86/nptl/pt-longjmp.c +++ /dev/null @@ -1,71 +0,0 @@ -/* ABI compatibility for 'longjmp' and 'siglongjmp' symbols in libpthread ABI. - X86 version. - Copyright (C) 1918-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <pthreadP.h> -#include <jmp_buf-ssp.h> - -#ifdef __x86_64__ -# define SHADOW_STACK_POINTER_SIZE 8 -#else -# define SHADOW_STACK_POINTER_SIZE 4 -#endif - -/* Assert that the priv field in struct pthread_unwind_buf has space - to store shadow stack pointer. */ -_Static_assert ((offsetof (struct pthread_unwind_buf, priv) - <= SHADOW_STACK_POINTER_OFFSET) - && ((offsetof (struct pthread_unwind_buf, priv) - + sizeof (((struct pthread_unwind_buf *) 0)->priv)) - >= (SHADOW_STACK_POINTER_OFFSET - + SHADOW_STACK_POINTER_SIZE)), - "Shadow stack pointer is not within private storage " - "of pthread_unwind_buf."); - -#include <shlib-compat.h> - -/* libpthread once had its own longjmp (and siglongjmp alias), though there - was no apparent reason for it. There is no use in having a separate - symbol in libpthread, but the historical ABI requires it. For static - linking, there is no need to provide anything here--the libc version - will be linked in. For shared library ABI compatibility, there must be - longjmp and siglongjmp symbols in libpthread.so. - - With an IFUNC resolver, it would be possible to avoid the indirection, - but the IFUNC resolver might run before the __libc_longjmp symbol has - been relocated, in which case the IFUNC resolver would not be able to - provide the correct address. */ - -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22) - -static void __attribute__ ((noreturn, used)) -longjmp_compat (jmp_buf env, int val) -{ - /* NB: We call __libc_siglongjmp, instead of __libc_longjmp, since - __libc_longjmp is a private interface for cancellation which - doesn't restore shadow stack register. */ - __libc_siglongjmp (env, val); -} - -strong_alias (longjmp_compat, longjmp_alias) -compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0); - -strong_alias (longjmp_alias, siglongjmp_alias) -compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0); - -#endif