From 94e6ba153b80a91e97386594729cd36eab69f507 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 20 Aug 2017 06:30:29 -0700 Subject: Move ____longjmp_chk prototype to include/setjmp.h Move ____longjmp_chk prototype to include/setjmp.h and add attribute_hidden. * debug/longjmp_chk.c (____longjmp_chk): Moved to ... * include/setjmp.h (____longjmp_chk): Here. Add attribute_hidden. --- include/setjmp.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/setjmp.h') diff --git a/include/setjmp.h b/include/setjmp.h index 90f46976e3..e45328b18a 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -8,6 +8,9 @@ extern void __longjmp (__jmp_buf __env, int __val) __attribute__ ((__noreturn__)) attribute_hidden; +extern void ____longjmp_chk (__jmp_buf __env, int __val) + __attribute__ ((__noreturn__)) attribute_hidden; + /* Internal function to possibly save the current mask of blocked signals in ENV, and always set the flag saying whether or not it was saved. This is used by the machine-dependent definition of `__sigsetjmp'. -- cgit v1.2.3 From 3d1870fa3301c5cd00d5fdab0014c4e22b71fef2 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 3 Oct 2017 01:26:58 +0200 Subject: Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDEN On the Hurd, the rtld needs to see its own dumb versions of a few functions (defined in sysdeps/mach/hurd/dl-sysdep.c) overridden by libc's versions once loaded. rtld should thus not have hidden attribute for these. To achieve this, the Hurd port used to just define NO_HIDDEN, which disables it completely. For now, this changes that to disabling it for all rtld functions, for simplicity. See Roland's comment on https://sourceware.org/bugzilla/show_bug.cgi?id=15605#c5 The ld.so numbers remain at 8 .rel.plt 000000c8 00000c24 00000c24 00000c24 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 9 .plt 000001a0 00000cf0 00000cf0 00000cf0 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 10 .plt.got 00000010 00000e90 00000e90 00000e90 2**3 CONTENTS, ALLOC, LOAD, READONLY, CODE 18 .got.plt 00000070 0002d000 0002d000 0002c000 2**2 CONTENTS, ALLOC, LOAD, DATA which is about 3 times as much as on Linux. The libc.so numbers get divided by 3 (the remainings are mostly RPC stub calls) * include/libc-symbols.h [NO_RTLD_HIDDEN] (rtld_hidden_proto, rtld_hidden_tls_proto, rtld_hidden_def, rtld_hidden_weak, rtld_hidden_rtld_hidden_ver, data_def, rtld_hidden_data_weak, rtld_hidden_data_ver): Define to empty. * include/assert.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__assert_fail, __assert_perror_fail): Likewise. * include/dirent.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__rewinddir): Likewise. * include/libc-internal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__profile_frequency): Likewise. * include/setjmp.h (__sigsetjmp): Likewise. * include/signal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__sigaction, __libc_sigaction): Likewise. * include/stdlib.h [NO_RTLD_HIDDEN] (unsetenv, __strtoul_internal): Do not set hidden attribute. * include/string.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__stpcpy, __strdup, __strerror_t, __strsep_g, memchr, memcmp, memcpy, memmove, memset, rawmemchr, stpcpy, strchr, strcmp, strlen, strnlen, strsep): Likewise. * include/sys/stat.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__fxstat, __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64, __fxstatat64): Likewise. * include/sys/utsname.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__uname): Likewise. * include/sysdeps/generic/_itoa.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (_itoa_upper_digits, _itoa_lower_digits): Likewise. * sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not set. (NO_RTLD_HIDDEN): Set. * sysdeps/mach/hurd/configure: Refresh. * config.h.in: Refresh. --- ChangeLog | 32 ++++++++++++++++++++++++++++++++ config.h.in | 4 ++++ include/assert.h | 2 +- include/dirent.h | 2 +- include/libc-internal.h | 2 +- include/libc-symbols.h | 2 +- include/setjmp.h | 2 +- include/signal.h | 2 +- include/stdlib.h | 2 +- include/string.h | 2 +- include/sys/stat.h | 4 ++-- include/sys/utsname.h | 2 +- sysdeps/generic/_itoa.h | 2 +- sysdeps/mach/hurd/configure | 2 +- sysdeps/mach/hurd/configure.ac | 2 +- 15 files changed, 50 insertions(+), 14 deletions(-) (limited to 'include/setjmp.h') diff --git a/ChangeLog b/ChangeLog index a43569336d..9cbff977ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,35 @@ +2017-10-03 Samuel Thibault + + * include/libc-symbols.h [NO_RTLD_HIDDEN] (rtld_hidden_proto, + rtld_hidden_tls_proto, rtld_hidden_def, rtld_hidden_weak, + rtld_hidden_rtld_hidden_ver, data_def, rtld_hidden_data_weak, + rtld_hidden_data_ver): Define to empty. + * include/assert.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__assert_fail, + __assert_perror_fail): Likewise. + * include/dirent.h [IS_IN(rtld) && NO_RTLD_HIDDEN] + (__rewinddir): Likewise. + * include/libc-internal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] + (__profile_frequency): Likewise. + * include/setjmp.h (__sigsetjmp): Likewise. + * include/signal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__sigaction, + __libc_sigaction): Likewise. + * include/stdlib.h [NO_RTLD_HIDDEN] (unsetenv, __strtoul_internal): Do + not set hidden attribute. + * include/string.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__stpcpy, __strdup, + __strerror_t, __strsep_g, memchr, memcmp, memcpy, memmove, memset, + rawmemchr, stpcpy, strchr, strcmp, strlen, strnlen, strsep): Likewise. + * include/sys/stat.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__fxstat, + __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64, + __fxstatat64): Likewise. + * include/sys/utsname.h [IS_IN(rtld) && NO_RTLD_HIDDEN] + (__uname): Likewise. + * include/sysdeps/generic/_itoa.h [IS_IN(rtld) && NO_RTLD_HIDDEN] + (_itoa_upper_digits, _itoa_lower_digits): Likewise. + * sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not set. + (NO_RTLD_HIDDEN): Set. + * sysdeps/mach/hurd/configure: Refresh. + * config.h.in: Refresh. + 2017-10-02 Joseph Myers * sysdeps/ieee754/dbl-64/s_atan.c: Include . diff --git a/config.h.in b/config.h.in index 014fb4ea0e..0d38476fa4 100644 --- a/config.h.in +++ b/config.h.in @@ -89,6 +89,10 @@ include/libc-symbols.h that avoid PLT slots in the shared objects. */ #undef NO_HIDDEN +/* Define this to disable in rtld the 'hidden_proto' et al macros in + include/libc-symbols.h that avoid PLT slots in the shared objects. */ +#undef NO_RTLD_HIDDEN + /* Define this to disable lazy relocations in DSOs. */ #undef BIND_NOW diff --git a/include/assert.h b/include/assert.h index c0f7e1a91c..61cc8aa22f 100644 --- a/include/assert.h +++ b/include/assert.h @@ -20,7 +20,7 @@ extern void __assert_fail_base (const char *fmt, const char *assertion, const char *function) __THROW __attribute__ ((__noreturn__)) attribute_hidden; -# if IS_IN (libc) || IS_IN (rtld) +# if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN) hidden_proto (__assert_fail) hidden_proto (__assert_perror_fail) # endif diff --git a/include/dirent.h b/include/dirent.h index 6fcc2f391b..caaeb0be85 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -77,7 +77,7 @@ extern __typeof (scandirat) __scandirat; libc_hidden_proto (__scandirat) libc_hidden_proto (scandirat64) -# if IS_IN (rtld) +# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__rewinddir) __rewinddir attribute_hidden; # endif # endif diff --git a/include/libc-internal.h b/include/libc-internal.h index 7403c24e25..69cd781aee 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -49,7 +49,7 @@ extern void __libc_thread_freeres (void); /* Define and initialize `__progname' et. al. */ extern void __init_misc (int, char **, char **) attribute_hidden; -# if IS_IN (rtld) +# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__profile_frequency) __profile_frequency attribute_hidden; # endif diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 10fd2063b0..e0d4dc3170 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -558,7 +558,7 @@ for linking") # define libc_hidden_data_ver(local, name) #endif -#if IS_IN (rtld) +#if IS_IN (rtld) && !defined NO_RTLD_HIDDEN # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) # define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define rtld_hidden_def(name) hidden_def (name) diff --git a/include/setjmp.h b/include/setjmp.h index e45328b18a..c234287515 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -28,7 +28,7 @@ libc_hidden_proto (__libc_longjmp) libc_hidden_proto (_setjmp) libc_hidden_proto (__sigsetjmp) -# if IS_IN (rtld) +# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden; # endif #endif diff --git a/include/signal.h b/include/signal.h index 7cbe64b8ad..293258ad65 100644 --- a/include/signal.h +++ b/include/signal.h @@ -54,7 +54,7 @@ extern int __xpg_sigpause (int sig); /* Allocate real-time signal with highest/lowest available priority. */ extern int __libc_allocate_rtsig (int __high); -# if IS_IN (rtld) +# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__sigaction) __sigaction attribute_hidden; extern __typeof (__libc_sigaction) __libc_sigaction attribute_hidden; # endif diff --git a/include/stdlib.h b/include/stdlib.h index c0fcb95777..5974fb3d24 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -294,7 +294,7 @@ struct abort_msg_s extern struct abort_msg_s *__abort_msg; libc_hidden_proto (__abort_msg) -# if IS_IN (rtld) +# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (unsetenv) unsetenv attribute_hidden; extern __typeof (__strtoul_internal) __strtoul_internal attribute_hidden; # endif diff --git a/include/string.h b/include/string.h index 968d6fea05..bb4922cbbe 100644 --- a/include/string.h +++ b/include/string.h @@ -143,7 +143,7 @@ libc_hidden_builtin_proto (strspn) libc_hidden_builtin_proto (strstr) libc_hidden_builtin_proto (ffs) -#if IS_IN (rtld) +#if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__stpcpy) __stpcpy attribute_hidden; extern __typeof (__strdup) __strdup attribute_hidden; extern __typeof (__strerror_r) __strerror_r attribute_hidden; diff --git a/include/sys/stat.h b/include/sys/stat.h index eb44754185..b82d452780 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -14,7 +14,7 @@ extern int __mkdir (const char *__path, __mode_t __mode); libc_hidden_proto (__mkdir) extern int __mknod (const char *__path, __mode_t __mode, __dev_t __dev); -#if IS_IN (libc) || IS_IN (rtld) +#if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN) hidden_proto (__fxstat) hidden_proto (__fxstat64) hidden_proto (__lxstat) @@ -37,7 +37,7 @@ libc_hidden_proto (__xmknodat) libc_hidden_proto (__fxstatat) libc_hidden_proto (__fxstatat64) -# if IS_IN (rtld) +# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__fxstatat64) __fxstatat64 attribute_hidden; # endif diff --git a/include/sys/utsname.h b/include/sys/utsname.h index 14f4247dd4..9ed5fa2565 100644 --- a/include/sys/utsname.h +++ b/include/sys/utsname.h @@ -7,7 +7,7 @@ extern int __uname (struct utsname *__name); libc_hidden_proto (uname) libc_hidden_proto (__uname) -# if IS_IN (rtld) +# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__uname) __uname attribute_hidden; # endif #endif diff --git a/sysdeps/generic/_itoa.h b/sysdeps/generic/_itoa.h index a065ecb890..6998c0859f 100644 --- a/sysdeps/generic/_itoa.h +++ b/sysdeps/generic/_itoa.h @@ -46,7 +46,7 @@ extern char *_itoa (unsigned long long int value, char *buflim, extern const char _itoa_upper_digits[]; extern const char _itoa_lower_digits[]; -#if IS_IN (libc) || IS_IN (rtld) +#if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN) hidden_proto (_itoa_upper_digits) hidden_proto (_itoa_lower_digits) #endif diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure index 163b5c7730..66cc0ce3a5 100644 --- a/sysdeps/mach/hurd/configure +++ b/sysdeps/mach/hurd/configure @@ -1,6 +1,6 @@ # This file is generated from configure.ac by Autoconf. DO NOT EDIT! -$as_echo "#define NO_HIDDEN 1" >>confdefs.h +$as_echo "#define NO_RTLD_HIDDEN 1" >>confdefs.h if test -n "$sysheaders"; then diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac index 5539a8c8af..774ffc80a9 100644 --- a/sysdeps/mach/hurd/configure.ac +++ b/sysdeps/mach/hurd/configure.ac @@ -3,7 +3,7 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. dnl We need this setting because of the need for PLT calls in ld.so. dnl See Roland's comment in dnl https://sourceware.org/bugzilla/show_bug.cgi?id=15605 -AC_DEFINE([NO_HIDDEN]) +AC_DEFINE([NO_RTLD_HIDDEN]) if test -n "$sysheaders"; then OLD_CPPFLAGS=$CPPFLAGS -- cgit v1.2.3 From 8cb5295d3f642af43694ba39bc56c8575380aeb3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 9 Nov 2017 05:09:49 -0800 Subject: Add jmp_buf-macros.h Verify that sizes, alignments and field offsets of jmp_buf as well as sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined. Since jmp_buf is target specific, jmp_buf-macros.h is added for each Linux target. A new target must provides its own jmp_buf-macros.h. TODO: Hurd needs to provide a jmp_buf-macros.h. Tested with build-many-glibcs.py. * include/setjmp.h [!_ISOMAC]: Include and . [!_ISOMAC] (STR_HELPER): New. [!_ISOMAC] (STR): Likewise. [!_ISOMAC] (TEST_SIZE): Likewise. [!_ISOMAC] (TEST_ALIGN): Likewise. [!_ISOMAC] (TEST_OFFSET): Likewise. [!_ISOMAC] Add _Static_assert to check sizes, alignments and field offsets of jmp_buf as well as sigjmp_buf. * sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h: Likewise. --- ChangeLog | 42 ++++++++++++++++++++++ include/setjmp.h | 34 ++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h | 6 ++++ .../unix/sysv/linux/microblaze/jmp_buf-macros.h | 6 ++++ .../unix/sysv/linux/mips/mips32/jmp_buf-macros.h | 6 ++++ .../sysv/linux/mips/mips64/n32/jmp_buf-macros.h | 6 ++++ .../sysv/linux/mips/mips64/n64/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h | 6 ++++ .../sysv/linux/powerpc/powerpc32/jmp_buf-macros.h | 6 ++++ .../sysv/linux/powerpc/powerpc64/jmp_buf-macros.h | 6 ++++ .../unix/sysv/linux/s390/s390-32/jmp_buf-macros.h | 6 ++++ .../unix/sysv/linux/s390/s390-64/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h | 6 ++++ .../unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h | 6 ++++ .../unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h | 6 ++++ .../linux/tile/tilegx/tilegx32/jmp_buf-macros.h | 6 ++++ .../linux/tile/tilegx/tilegx64/jmp_buf-macros.h | 6 ++++ .../unix/sysv/linux/tile/tilepro/jmp_buf-macros.h | 6 ++++ sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h | 6 ++++ .../unix/sysv/linux/x86_64/x32/jmp_buf-macros.h | 6 ++++ 26 files changed, 220 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h (limited to 'include/setjmp.h') diff --git a/ChangeLog b/ChangeLog index bc8c473f09..475945bc32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,45 @@ +2017-11-09 H.J. Lu + + * include/setjmp.h [!_ISOMAC]: Include and + . + [!_ISOMAC] (STR_HELPER): New. + [!_ISOMAC] (STR): Likewise. + [!_ISOMAC] (TEST_SIZE): Likewise. + [!_ISOMAC] (TEST_ALIGN): Likewise. + [!_ISOMAC] (TEST_OFFSET): Likewise. + [!_ISOMAC] Add _Static_assert to check sizes, alignments and + field offsets of jmp_buf as well as sigjmp_buf. + * sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h: + Likewise. + * sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h: + Likewise. + * sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h: + Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h: + Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h: + Likewise. + * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h: + Likewise. + * sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h: Likewise. + 2017-11-07 Joseph Myers * include/float.h diff --git a/include/setjmp.h b/include/setjmp.h index c234287515..f1b19f5ceb 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -31,6 +31,40 @@ libc_hidden_proto (__sigsetjmp) # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden; # endif + +/* Check jmp_buf sizes, alignments and offsets. */ +# include +# include + +# define STR_HELPER(x) #x +# define STR(x) STR_HELPER(x) + +# define TEST_SIZE(type, size) \ + _Static_assert (sizeof (type) == size, \ + "size of " #type " != " \ + STR (size)) +# define TEST_ALIGN(type, align) \ + _Static_assert (__alignof__ (type) == align , \ + "align of " #type " != " \ + STR (align)) +# define TEST_OFFSET(type, member, offset) \ + _Static_assert (offsetof (type, member) == offset, \ + "offset of " #member " field of " #type " != " \ + STR (offset)) + +/* Check if jmp_buf have the expected sizes. */ +TEST_SIZE (jmp_buf, JMP_BUF_SIZE); +TEST_SIZE (sigjmp_buf, SIGJMP_BUF_SIZE); + +/* Check if jmp_buf have the expected alignments. */ +TEST_ALIGN (jmp_buf, JMP_BUF_ALIGN); +TEST_ALIGN (sigjmp_buf, SIGJMP_BUF_ALIGN); + +/* Check if internal fields in jmp_buf have the expected offsets. */ +TEST_OFFSET (struct __jmp_buf_tag, __mask_was_saved, + MASK_WAS_SAVED_OFFSET); +TEST_OFFSET (struct __jmp_buf_tag, __saved_mask, + SAVED_MASK_OFFSET); #endif #endif diff --git a/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h new file mode 100644 index 0000000000..608a7ad1f7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 312 +#define SIGJMP_BUF_SIZE 312 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 176 +#define SAVED_MASK_OFFSET 184 diff --git a/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h new file mode 100644 index 0000000000..b595173e6f --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 272 +#define SIGJMP_BUF_SIZE 272 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 136 +#define SAVED_MASK_OFFSET 144 diff --git a/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h new file mode 100644 index 0000000000..eb64802525 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 392 +#define SIGJMP_BUF_SIZE 392 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 256 +#define SAVED_MASK_OFFSET 260 diff --git a/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h new file mode 100644 index 0000000000..6ede0d6af7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 304 +#define SIGJMP_BUF_SIZE 304 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 168 +#define SAVED_MASK_OFFSET 172 diff --git a/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h new file mode 100644 index 0000000000..554bbed309 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 156 +#define SIGJMP_BUF_SIZE 156 +#define JMP_BUF_ALIGN 4 +#define SIGJMP_BUF_ALIGN 4 +#define MASK_WAS_SAVED_OFFSET 24 +#define SAVED_MASK_OFFSET 28 diff --git a/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h new file mode 100644 index 0000000000..41788657ec --- /dev/null +++ b/sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 704 +#define SIGJMP_BUF_SIZE 704 +#define JMP_BUF_ALIGN 16 +#define SIGJMP_BUF_ALIGN 16 +#define MASK_WAS_SAVED_OFFSET 560 +#define SAVED_MASK_OFFSET 568 diff --git a/sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h new file mode 100644 index 0000000000..2f62ecb4b3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 288 +#define SIGJMP_BUF_SIZE 288 +#define JMP_BUF_ALIGN 2 +#define SIGJMP_BUF_ALIGN 2 +#define MASK_WAS_SAVED_OFFSET 156 +#define SAVED_MASK_OFFSET 160 diff --git a/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h new file mode 100644 index 0000000000..9c435f7967 --- /dev/null +++ b/sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 216 +#define SIGJMP_BUF_SIZE 216 +#define JMP_BUF_ALIGN 4 +#define SIGJMP_BUF_ALIGN 4 +#define MASK_WAS_SAVED_OFFSET 84 +#define SAVED_MASK_OFFSET 88 diff --git a/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h new file mode 100644 index 0000000000..d46d69ecbd --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 240 +#define SIGJMP_BUF_SIZE 240 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 104 +#define SAVED_MASK_OFFSET 108 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h new file mode 100644 index 0000000000..ed0f1232de --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 288 +#define SIGJMP_BUF_SIZE 288 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 152 +#define SAVED_MASK_OFFSET 156 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h new file mode 100644 index 0000000000..38b5b0636a --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 304 +#define SIGJMP_BUF_SIZE 304 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 168 +#define SAVED_MASK_OFFSET 176 diff --git a/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h new file mode 100644 index 0000000000..1cb9cab420 --- /dev/null +++ b/sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 172 +#define SIGJMP_BUF_SIZE 172 +#define JMP_BUF_ALIGN 4 +#define SIGJMP_BUF_ALIGN 4 +#define MASK_WAS_SAVED_OFFSET 40 +#define SAVED_MASK_OFFSET 44 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h new file mode 100644 index 0000000000..11b0a8bb00 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 592 +#define SIGJMP_BUF_SIZE 592 +#define JMP_BUF_ALIGN 16 +#define SIGJMP_BUF_ALIGN 16 +#define MASK_WAS_SAVED_OFFSET 448 +#define SAVED_MASK_OFFSET 452 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h new file mode 100644 index 0000000000..d3e0d4e146 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 656 +#define SIGJMP_BUF_SIZE 656 +#define JMP_BUF_ALIGN 16 +#define SIGJMP_BUF_ALIGN 16 +#define MASK_WAS_SAVED_OFFSET 512 +#define SAVED_MASK_OFFSET 520 diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h new file mode 100644 index 0000000000..0f29ff90d0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 188 +#define SIGJMP_BUF_SIZE 188 +#define JMP_BUF_ALIGN 4 +#define SIGJMP_BUF_ALIGN 4 +#define MASK_WAS_SAVED_OFFSET 56 +#define SAVED_MASK_OFFSET 60 diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h new file mode 100644 index 0000000000..4e5f348eaf --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 280 +#define SIGJMP_BUF_SIZE 280 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 144 +#define SAVED_MASK_OFFSET 152 diff --git a/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h new file mode 100644 index 0000000000..b2bc30db5d --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 192 +#define SIGJMP_BUF_SIZE 192 +#define JMP_BUF_ALIGN 4 +#define SIGJMP_BUF_ALIGN 4 +#define MASK_WAS_SAVED_OFFSET 60 +#define SAVED_MASK_OFFSET 64 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h new file mode 100644 index 0000000000..388533f88a --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 144 +#define SIGJMP_BUF_SIZE 144 +#define JMP_BUF_ALIGN 4 +#define SIGJMP_BUF_ALIGN 4 +#define MASK_WAS_SAVED_OFFSET 12 +#define SAVED_MASK_OFFSET 16 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h new file mode 100644 index 0000000000..e86afd7b3d --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 640 +#define SIGJMP_BUF_SIZE 640 +#define JMP_BUF_ALIGN 16 +#define SIGJMP_BUF_ALIGN 16 +#define MASK_WAS_SAVED_OFFSET 496 +#define SAVED_MASK_OFFSET 504 diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h new file mode 100644 index 0000000000..eb64802525 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 392 +#define SIGJMP_BUF_SIZE 392 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 256 +#define SAVED_MASK_OFFSET 260 diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h new file mode 100644 index 0000000000..685f9b8236 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 392 +#define SIGJMP_BUF_SIZE 392 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 256 +#define SAVED_MASK_OFFSET 264 diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h new file mode 100644 index 0000000000..411e62a047 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 260 +#define SIGJMP_BUF_SIZE 260 +#define JMP_BUF_ALIGN 4 +#define SIGJMP_BUF_ALIGN 4 +#define MASK_WAS_SAVED_OFFSET 128 +#define SAVED_MASK_OFFSET 132 diff --git a/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h new file mode 100644 index 0000000000..3ae63ab5c5 --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 200 +#define SIGJMP_BUF_SIZE 200 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 64 +#define SAVED_MASK_OFFSET 72 diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h new file mode 100644 index 0000000000..2fa8e9ec38 --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h @@ -0,0 +1,6 @@ +#define JMP_BUF_SIZE 200 +#define SIGJMP_BUF_SIZE 200 +#define JMP_BUF_ALIGN 8 +#define SIGJMP_BUF_ALIGN 8 +#define MASK_WAS_SAVED_OFFSET 64 +#define SAVED_MASK_OFFSET 68 -- cgit v1.2.3 From 6253bacdc00de132dec452ff7c6ce3ba7fa23d81 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 10 Mar 2018 09:27:04 -0800 Subject: Remove hidden __libc_longjmp Since __libc_longjmp is a private interface for cancellation implementation in libpthread, there is no need to provide hidden __libc_longjmp in libc. Tested with build-many-glibcs.py. * include/setjmp.h (__libc_longjmp): Remove libc_hidden_proto. * setjmp/longjmp.c (__libc_longjmp): Remove libc_hidden_def. * sysdeps/s390/longjmp.c (__libc_longjmp): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S (__libc_longjmp): Likewise. --- ChangeLog | 8 ++++++++ include/setjmp.h | 1 - setjmp/longjmp.c | 3 ++- sysdeps/s390/longjmp.c | 1 - sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S | 1 - 5 files changed, 10 insertions(+), 4 deletions(-) (limited to 'include/setjmp.h') diff --git a/ChangeLog b/ChangeLog index 0f71d41b0a..8490083ead 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2018-03-10 H.J. Lu + + * include/setjmp.h (__libc_longjmp): Remove libc_hidden_proto. + * setjmp/longjmp.c (__libc_longjmp): Remove libc_hidden_def. + * sysdeps/s390/longjmp.c (__libc_longjmp): Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S (__libc_longjmp): + Likewise. + 2018-03-09 Florian Weimer * malloc/malloc.c (prev_size, set_prev_size, prev_chunk): Fix typo diff --git a/include/setjmp.h b/include/setjmp.h index f1b19f5ceb..263bc64b3d 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -23,7 +23,6 @@ extern void __libc_siglongjmp (sigjmp_buf env, int val) __attribute__ ((noreturn)); extern void __libc_longjmp (sigjmp_buf env, int val) __attribute__ ((noreturn)); -libc_hidden_proto (__libc_longjmp) libc_hidden_proto (_setjmp) libc_hidden_proto (__sigsetjmp) diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c index 6b4737605a..a2a7065a85 100644 --- a/setjmp/longjmp.c +++ b/setjmp/longjmp.c @@ -40,8 +40,9 @@ __libc_siglongjmp (sigjmp_buf env, int val) } #ifndef __libc_siglongjmp +/* __libc_longjmp is a private interface for cancellation implementation + in libpthread. */ strong_alias (__libc_siglongjmp, __libc_longjmp) -libc_hidden_def (__libc_longjmp) weak_alias (__libc_siglongjmp, _longjmp) weak_alias (__libc_siglongjmp, longjmp) weak_alias (__libc_siglongjmp, siglongjmp) diff --git a/sysdeps/s390/longjmp.c b/sysdeps/s390/longjmp.c index 6343c261b5..e61cdba2a3 100644 --- a/sysdeps/s390/longjmp.c +++ b/sysdeps/s390/longjmp.c @@ -33,7 +33,6 @@ but were reverted before 2.20. Thus both versions are the same function. */ strong_alias (__libc_siglongjmp, __libc_longjmp) -libc_hidden_def (__libc_longjmp) weak_alias (__libc_siglongjmp, __v1_longjmp) weak_alias (__libc_siglongjmp, __v2_longjmp) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S index 208c6db3a9..5937396fc7 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S @@ -45,7 +45,6 @@ END(__libc_siglongjmp) strong_alias(__libc_siglongjmp, __longjmp) strong_alias(__libc_siglongjmp, __libc_longjmp) -libc_hidden_def (__libc_longjmp) weak_alias (__libc_siglongjmp, longjmp) weak_alias (__libc_siglongjmp, _longjmp) weak_alias (__libc_siglongjmp, siglongjmp) -- cgit v1.2.3 From 82dbf555a4d41690f63b94ccb4db4bf43d873aa0 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 3 Apr 2018 00:34:31 +0000 Subject: hurd: Avoid more libc.so local PLTs * hurd/catch-signal.c (__hurd_catch_signal): Call __libc_siglongjmp instead if siglongjmp. (hurd_safe_memmove): Call __libc_longjmp instead of longjmp. * hurd/hurdfault.c (faulted): Call __libc_longjmp instead of longjmp. * include/setjmp.h (__libc_siglongjmp, __libc_longjmp): New hidden prototypes. * libio/iolibio.h (_IO_puts): New hidden prototype. * libio/ioputs.c (_IO_puts): New hidden def. * setjmp/longjmp.c (__libc_longjmp, __libc_siglongjmp): New hidden defs. * sysdeps/mach/hurd/sigwait.c (__sigwait): Call __libc_longjmp instead of longjmp. --- ChangeLog | 12 ++++++++++++ hurd/catch-signal.c | 4 ++-- hurd/hurdfault.c | 2 +- include/setjmp.h | 3 +++ libio/iolibio.h | 1 + libio/ioputs.c | 1 + setjmp/longjmp.c | 2 ++ sysdeps/mach/hurd/sigwait.c | 2 +- 8 files changed, 23 insertions(+), 4 deletions(-) (limited to 'include/setjmp.h') diff --git a/ChangeLog b/ChangeLog index 9e2dfa934d..0b54ed73b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -396,6 +396,18 @@ _hurd_fd_error_signal): Add hidden prototype. [_HURD_FD_H_HIDDEN_DEF] (_hurd_fd_error, _hurd_fd_error_signal): Add hidden def. + * hurd/catch-signal.c (__hurd_catch_signal): Call __libc_siglongjmp + instead if siglongjmp. + (hurd_safe_memmove): Call __libc_longjmp instead of longjmp. + * hurd/hurdfault.c (faulted): Call __libc_longjmp instead of longjmp. + * include/setjmp.h (__libc_siglongjmp, __libc_longjmp): New hidden + prototypes. + * libio/iolibio.h (_IO_puts): New hidden prototype. + * libio/ioputs.c (_IO_puts): New hidden def. + * setjmp/longjmp.c (__libc_longjmp, __libc_siglongjmp): New hidden + defs. + * sysdeps/mach/hurd/sigwait.c (__sigwait): Call __libc_longjmp instead + of longjmp. * sysdeps/mach/hurd/localplt.data: New file. diff --git a/hurd/catch-signal.c b/hurd/catch-signal.c index 56ce86532d..a00ccef4fb 100644 --- a/hurd/catch-signal.c +++ b/hurd/catch-signal.c @@ -32,7 +32,7 @@ __hurd_catch_signal (sigset_t sigset, instance calling hurd_catch_signal again would then dump core. */ sigjmp_buf buf; void throw (int signo, long int sigcode, struct sigcontext *scp) - { siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); } + { __libc_siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); } struct hurd_signal_preemptor preemptor = { @@ -121,7 +121,7 @@ hurd_safe_memmove (void *dest, const void *src, size_t nbytes) { jmp_buf buf; void throw (int signo, long int sigcode, struct sigcontext *scp) - { longjmp (buf, scp->sc_error ?: EGRATUITOUS); } + { __libc_longjmp (buf, scp->sc_error ?: EGRATUITOUS); } struct hurd_signal_preemptor src_preemptor = { diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c index 39a4522811..c42d5e739a 100644 --- a/hurd/hurdfault.c +++ b/hurd/hurdfault.c @@ -152,7 +152,7 @@ faulted (void) __libc_fatal ("BUG: unexpected fault in signal thread\n"); _hurdsig_fault_preemptor.signals = 0; - longjmp (_hurdsig_fault_env, 1); + __libc_longjmp (_hurdsig_fault_env, 1); } static char faultstack[1024]; diff --git a/include/setjmp.h b/include/setjmp.h index 263bc64b3d..682ff4b5a5 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -24,6 +24,9 @@ extern void __libc_siglongjmp (sigjmp_buf env, int val) extern void __libc_longjmp (sigjmp_buf env, int val) __attribute__ ((noreturn)); +libc_hidden_proto (__libc_siglongjmp) +libc_hidden_proto (__libc_longjmp) + libc_hidden_proto (_setjmp) libc_hidden_proto (__sigsetjmp) diff --git a/libio/iolibio.h b/libio/iolibio.h index 69e1c0e699..6c94fe6d62 100644 --- a/libio/iolibio.h +++ b/libio/iolibio.h @@ -41,6 +41,7 @@ extern char* _IO_gets (char*); extern void _IO_perror (const char*) __THROW; extern int _IO_printf (const char*, ...); extern int _IO_puts (const char*); +libc_hidden_proto (_IO_puts) extern int _IO_scanf (const char*, ...); extern void _IO_setbuffer (FILE *, char*, size_t) __THROW; libc_hidden_proto (_IO_setbuffer) diff --git a/libio/ioputs.c b/libio/ioputs.c index 0a80fb7148..c9967c3883 100644 --- a/libio/ioputs.c +++ b/libio/ioputs.c @@ -46,3 +46,4 @@ _IO_puts (const char *str) } weak_alias (_IO_puts, puts) +libc_hidden_def (_IO_puts) diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c index a2a7065a85..0555d6d6b7 100644 --- a/setjmp/longjmp.c +++ b/setjmp/longjmp.c @@ -46,4 +46,6 @@ strong_alias (__libc_siglongjmp, __libc_longjmp) weak_alias (__libc_siglongjmp, _longjmp) weak_alias (__libc_siglongjmp, longjmp) weak_alias (__libc_siglongjmp, siglongjmp) +libc_hidden_def (__libc_longjmp) +libc_hidden_def (__libc_siglongjmp) #endif diff --git a/sysdeps/mach/hurd/sigwait.c b/sysdeps/mach/hurd/sigwait.c index ce17cce895..321ab46d14 100644 --- a/sysdeps/mach/hurd/sigwait.c +++ b/sysdeps/mach/hurd/sigwait.c @@ -59,7 +59,7 @@ __sigwait (const sigset_t *set, int *sig) handler (int sig) { assert (sig == signo); - longjmp (buf, 1); + __libc_longjmp (buf, 1); } wait = __mach_reply_port (); -- cgit v1.2.3 From 5e17a480f83061a0dd0228b7e6415520f3136f94 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 3 Apr 2018 23:00:14 +0200 Subject: Revert parts of "hurd: Avoid more libc.so local PLTs" This reverts parts of commit 82dbf555a4d41690f63b94ccb4db4bf43d873aa0. --- ChangeLog | 11 ----------- hurd/catch-signal.c | 4 ++-- hurd/hurdfault.c | 2 +- include/setjmp.h | 3 --- setjmp/longjmp.c | 2 -- sysdeps/mach/hurd/sigwait.c | 2 +- 6 files changed, 4 insertions(+), 20 deletions(-) (limited to 'include/setjmp.h') diff --git a/ChangeLog b/ChangeLog index d2dabfb3f5..dd78bf691a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -521,19 +521,8 @@ _hurd_fd_error_signal): Add hidden prototype. [_HURD_FD_H_HIDDEN_DEF] (_hurd_fd_error, _hurd_fd_error_signal): Add hidden def. - * hurd/catch-signal.c (__hurd_catch_signal): Call __libc_siglongjmp - instead if siglongjmp. - (hurd_safe_memmove): Call __libc_longjmp instead of longjmp. - * hurd/hurdfault.c (faulted): Call __libc_longjmp instead of longjmp. - * include/setjmp.h (__libc_siglongjmp, __libc_longjmp): New hidden - prototypes. * libio/iolibio.h (_IO_puts): New hidden prototype. * libio/ioputs.c (_IO_puts): New hidden def. - * setjmp/longjmp.c (__libc_longjmp, __libc_siglongjmp): New hidden - defs. - * sysdeps/mach/hurd/sigwait.c (__sigwait): Call __libc_longjmp instead - of longjmp. - * sysdeps/mach/hurd/localplt.data: New file. 2018-04-02 Agustina Arzille diff --git a/hurd/catch-signal.c b/hurd/catch-signal.c index a00ccef4fb..56ce86532d 100644 --- a/hurd/catch-signal.c +++ b/hurd/catch-signal.c @@ -32,7 +32,7 @@ __hurd_catch_signal (sigset_t sigset, instance calling hurd_catch_signal again would then dump core. */ sigjmp_buf buf; void throw (int signo, long int sigcode, struct sigcontext *scp) - { __libc_siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); } + { siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); } struct hurd_signal_preemptor preemptor = { @@ -121,7 +121,7 @@ hurd_safe_memmove (void *dest, const void *src, size_t nbytes) { jmp_buf buf; void throw (int signo, long int sigcode, struct sigcontext *scp) - { __libc_longjmp (buf, scp->sc_error ?: EGRATUITOUS); } + { longjmp (buf, scp->sc_error ?: EGRATUITOUS); } struct hurd_signal_preemptor src_preemptor = { diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c index c42d5e739a..39a4522811 100644 --- a/hurd/hurdfault.c +++ b/hurd/hurdfault.c @@ -152,7 +152,7 @@ faulted (void) __libc_fatal ("BUG: unexpected fault in signal thread\n"); _hurdsig_fault_preemptor.signals = 0; - __libc_longjmp (_hurdsig_fault_env, 1); + longjmp (_hurdsig_fault_env, 1); } static char faultstack[1024]; diff --git a/include/setjmp.h b/include/setjmp.h index 682ff4b5a5..263bc64b3d 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -24,9 +24,6 @@ extern void __libc_siglongjmp (sigjmp_buf env, int val) extern void __libc_longjmp (sigjmp_buf env, int val) __attribute__ ((noreturn)); -libc_hidden_proto (__libc_siglongjmp) -libc_hidden_proto (__libc_longjmp) - libc_hidden_proto (_setjmp) libc_hidden_proto (__sigsetjmp) diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c index 0555d6d6b7..a2a7065a85 100644 --- a/setjmp/longjmp.c +++ b/setjmp/longjmp.c @@ -46,6 +46,4 @@ strong_alias (__libc_siglongjmp, __libc_longjmp) weak_alias (__libc_siglongjmp, _longjmp) weak_alias (__libc_siglongjmp, longjmp) weak_alias (__libc_siglongjmp, siglongjmp) -libc_hidden_def (__libc_longjmp) -libc_hidden_def (__libc_siglongjmp) #endif diff --git a/sysdeps/mach/hurd/sigwait.c b/sysdeps/mach/hurd/sigwait.c index 321ab46d14..ce17cce895 100644 --- a/sysdeps/mach/hurd/sigwait.c +++ b/sysdeps/mach/hurd/sigwait.c @@ -59,7 +59,7 @@ __sigwait (const sigset_t *set, int *sig) handler (int sig) { assert (sig == signo); - __libc_longjmp (buf, 1); + longjmp (buf, 1); } wait = __mach_reply_port (); -- cgit v1.2.3 From e5f9508a32426b7c3948dc741d84355071ed9539 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 4 Apr 2018 23:19:18 +0000 Subject: hurd: Avoid PLTs for longjmp & siglongjmp * include/setjmp.h (longjmp, siglongjmp): Add hidden protos. * setjmp/longjmp.c (longjmp, siglongjmp): Add hidden defs. * sysdeps/s390/longjmp.c (longjmp, siglongjmp): Add hidden defs. --- ChangeLog | 6 ++++++ include/setjmp.h | 2 ++ setjmp/longjmp.c | 2 ++ sysdeps/s390/longjmp.c | 2 ++ 4 files changed, 12 insertions(+) (limited to 'include/setjmp.h') diff --git a/ChangeLog b/ChangeLog index 174bb6a46a..58d4d94ec0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-04-05 Samuel Thibault + + * include/setjmp.h (longjmp, siglongjmp): Add hidden protos. + * setjmp/longjmp.c (longjmp, siglongjmp): Add hidden defs. + * sysdeps/s390/longjmp.c (longjmp, siglongjmp): Add hidden defs. + 2018-04-04 Tulio Magno Quites Machado Filho * sysdeps/powerpc/fpu/libm-test-ulps: Increase double-precision diff --git a/include/setjmp.h b/include/setjmp.h index 263bc64b3d..ed582516c9 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -26,6 +26,8 @@ extern void __libc_longjmp (sigjmp_buf env, int val) libc_hidden_proto (_setjmp) libc_hidden_proto (__sigsetjmp) +libc_hidden_proto (longjmp) +libc_hidden_proto (siglongjmp) # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden; diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c index a2a7065a85..72d43f45df 100644 --- a/setjmp/longjmp.c +++ b/setjmp/longjmp.c @@ -45,5 +45,7 @@ __libc_siglongjmp (sigjmp_buf env, int val) strong_alias (__libc_siglongjmp, __libc_longjmp) weak_alias (__libc_siglongjmp, _longjmp) weak_alias (__libc_siglongjmp, longjmp) +libc_hidden_def (longjmp) weak_alias (__libc_siglongjmp, siglongjmp) +libc_hidden_def (siglongjmp) #endif diff --git a/sysdeps/s390/longjmp.c b/sysdeps/s390/longjmp.c index e61cdba2a3..1064647ee0 100644 --- a/sysdeps/s390/longjmp.c +++ b/sysdeps/s390/longjmp.c @@ -43,9 +43,11 @@ weak_alias (__libc_siglongjmp, __v1longjmp) weak_alias (__libc_siglongjmp, __v2longjmp) versioned_symbol (libc, __v1longjmp, longjmp, GLIBC_2_0); compat_symbol (libc, __v2longjmp, longjmp, GLIBC_2_19); +libc_hidden_def (longjmp) weak_alias (__libc_siglongjmp, __v1siglongjmp) weak_alias (__libc_siglongjmp, __v2siglongjmp) versioned_symbol (libc, __v1siglongjmp, siglongjmp, GLIBC_2_0); compat_symbol (libc, __v2siglongjmp, siglongjmp, GLIBC_2_19); +libc_hidden_def (siglongjmp) #endif /* SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ -- cgit v1.2.3 From 08e92e2443a6ca4cfd45b87e22bef3454f369752 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 5 Apr 2018 09:38:58 +0200 Subject: Revert "hurd: Avoid PLTs for longjmp & siglongjmp" This reverts commit e5f9508a32426b7c3948dc741d84355071ed9539. --- ChangeLog | 3 --- include/setjmp.h | 2 -- setjmp/longjmp.c | 2 -- sysdeps/s390/longjmp.c | 2 -- 4 files changed, 9 deletions(-) (limited to 'include/setjmp.h') diff --git a/ChangeLog b/ChangeLog index 73ce5991f3..af6e325aaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,5 @@ 2018-04-05 Samuel Thibault - * include/setjmp.h (longjmp, siglongjmp): Add hidden protos. - * setjmp/longjmp.c (longjmp, siglongjmp): Add hidden defs. - * sysdeps/s390/longjmp.c (longjmp, siglongjmp): Add hidden defs. * include/dirent.h (dirfd): Add hidden proto. * dirent/dirfd.c (dirfd): Add hidden def. * sysdeps/mach/hurd/dirfd.c (dirfd): Add hidden def. diff --git a/include/setjmp.h b/include/setjmp.h index ed582516c9..263bc64b3d 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -26,8 +26,6 @@ extern void __libc_longjmp (sigjmp_buf env, int val) libc_hidden_proto (_setjmp) libc_hidden_proto (__sigsetjmp) -libc_hidden_proto (longjmp) -libc_hidden_proto (siglongjmp) # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden; diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c index 72d43f45df..a2a7065a85 100644 --- a/setjmp/longjmp.c +++ b/setjmp/longjmp.c @@ -45,7 +45,5 @@ __libc_siglongjmp (sigjmp_buf env, int val) strong_alias (__libc_siglongjmp, __libc_longjmp) weak_alias (__libc_siglongjmp, _longjmp) weak_alias (__libc_siglongjmp, longjmp) -libc_hidden_def (longjmp) weak_alias (__libc_siglongjmp, siglongjmp) -libc_hidden_def (siglongjmp) #endif diff --git a/sysdeps/s390/longjmp.c b/sysdeps/s390/longjmp.c index 1064647ee0..e61cdba2a3 100644 --- a/sysdeps/s390/longjmp.c +++ b/sysdeps/s390/longjmp.c @@ -43,11 +43,9 @@ weak_alias (__libc_siglongjmp, __v1longjmp) weak_alias (__libc_siglongjmp, __v2longjmp) versioned_symbol (libc, __v1longjmp, longjmp, GLIBC_2_0); compat_symbol (libc, __v2longjmp, longjmp, GLIBC_2_19); -libc_hidden_def (longjmp) weak_alias (__libc_siglongjmp, __v1siglongjmp) weak_alias (__libc_siglongjmp, __v2siglongjmp) versioned_symbol (libc, __v1siglongjmp, siglongjmp, GLIBC_2_0); compat_symbol (libc, __v2siglongjmp, siglongjmp, GLIBC_2_19); -libc_hidden_def (siglongjmp) #endif /* SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ -- cgit v1.2.3