From 37d13b179cd726bb6d61bfe2f31a1206bc1d9703 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Mon, 9 Nov 2015 16:14:49 +0100 Subject: S390: Clean setjmp, longjmp, getcontext symbols. For each function setjmp, longjmp, getcontext, there exist a symbol and a default/versioned symbol @@GLIBC_2.x in the build obj-files. This is wrong because it should only exist an unversioned or a default-versioned symbol with the same name in an obj-file. Glibc can't be build with recent binutils. See the already fixed linker bug https://sourceware.org/bugzilla/show_bug.cgi?id=19073. Nevertheless, this patch cleans this up. Furthermore the BSD entry points setjmp, _setjmp were marked as weak, but should be strong as on other architectures. (see https://sourceware.org/ml/libc-alpha/2014-07/msg00568.html for an older discussion with Andreas Schwab) Some whitespace issues are corrected in sysdeps/s390/s390-64/setjmp.S, too. But there is no change in the assembler code. ChangeLog: * sysdeps/s390/longjmp.c (longjmp, _longjmp, siglongjmp): Don't create weak aliases, because versioned symbols are created later. * sysdeps/s390/s390-32/setjmp.S (setjmp, _setjmp): Remove weak and rename to an unique name in SHARED case due to existing versioned symbols. * sysdeps/s390/s390-64/setjmp.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S (getcontext): Create weak alias only in non SHARED case. * sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S: Likewise. --- ChangeLog | 13 +++++++++ sysdeps/s390/longjmp.c | 10 +++++++ sysdeps/s390/s390-32/setjmp.S | 18 ++++++------ sysdeps/s390/s390-64/setjmp.S | 34 ++++++++++++----------- sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S | 9 ++++-- sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S | 9 ++++-- 6 files changed, 63 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8cd164779..2918a23a4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2015-11-09 Stefan Liebler + + * sysdeps/s390/longjmp.c (longjmp, _longjmp, siglongjmp): + Don't create weak aliases, + because versioned symbols are created later. + * sysdeps/s390/s390-32/setjmp.S + (setjmp, _setjmp): Remove weak and rename to an unique name + in SHARED case due to existing versioned symbols. + * sysdeps/s390/s390-64/setjmp.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S + (getcontext): Create weak alias only in non SHARED case. + * sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S: Likewise. + 2015-11-09 Stefan Liebler * sysdeps/unix/sysv/linux/s390/kernel-features.h: diff --git a/sysdeps/s390/longjmp.c b/sysdeps/s390/longjmp.c index 9b6fa54d7b..cd2c842233 100644 --- a/sysdeps/s390/longjmp.c +++ b/sysdeps/s390/longjmp.c @@ -20,11 +20,21 @@ #include +#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) +/* We don't want the weak alias to longjmp, _longjmp, siglongjmp here, + because we create the default/versioned symbols later. */ +# define __libc_siglongjmp __libc_siglongjmp +#endif /* SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ + #include #if defined SHARED && SHLIB_COMPAT (libc, 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 (__libc_siglongjmp, __libc_longjmp) +libc_hidden_def (__libc_longjmp) + weak_alias (__libc_siglongjmp, __v1_longjmp) weak_alias (__libc_siglongjmp, __v2_longjmp) versioned_symbol (libc, __v1_longjmp, _longjmp, GLIBC_2_0); diff --git a/sysdeps/s390/s390-32/setjmp.S b/sysdeps/s390/s390-32/setjmp.S index e068a3cbfe..3543c65540 100644 --- a/sysdeps/s390/s390-32/setjmp.S +++ b/sysdeps/s390/s390-32/setjmp.S @@ -27,21 +27,23 @@ #if !IS_IN (rtld) # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) /* we need a unique name in case of symbol versioning. */ +# define setjmp __v1setjmp +# define _setjmp __v1_setjmp # define __sigsetjmp __v1__sigsetjmp + +# undef libc_hidden_def +# define libc_hidden_def(name) strong_alias(_setjmp, __GI__setjmp) # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ #endif /* !IS_IN (rtld) */ - /* We include the BSD entry points here as well but we make - them weak. */ + /* We include the BSD entry points here as well. */ ENTRY (setjmp) - .weak C_SYMBOL_NAME (setjmp) lhi %r3,1 /* second argument of one */ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */ END (setjmp) /* Binary compatibility entry point. */ ENTRY(_setjmp) - .weak C_SYMBOL_NAME (_setjmp) lhi %r3,0 /* second argument of zero */ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */ END (_setjmp) @@ -96,15 +98,15 @@ END (__sigsetjmp) /* In glibc release 2.19 new versions of setjmp-functions were introduced, but were reverted before 2.20. Thus both versions are the same function. */ +# undef setjmp +# undef _setjmp # undef __sigsetjmp -weak_alias (setjmp, __v1setjmp); -weak_alias (setjmp, __v2setjmp); +strong_alias (__v1setjmp, __v2setjmp); versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0); compat_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19); -weak_alias (_setjmp, __v1_setjmp); -weak_alias (_setjmp, __v2_setjmp); +strong_alias (__v1_setjmp, __v2_setjmp); versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0); compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19); diff --git a/sysdeps/s390/s390-64/setjmp.S b/sysdeps/s390/s390-64/setjmp.S index 330a8e6c62..ae48ab48e5 100644 --- a/sysdeps/s390/s390-64/setjmp.S +++ b/sysdeps/s390/s390-64/setjmp.S @@ -27,29 +27,31 @@ #if !IS_IN (rtld) # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) /* we need a unique name in case of symbol versioning. */ +# define setjmp __v1setjmp +# define _setjmp __v1_setjmp # define __sigsetjmp __v1__sigsetjmp + +# undef libc_hidden_def +# define libc_hidden_def(name) strong_alias(_setjmp, __GI__setjmp) # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ #endif /* !IS_IN (rtld) */ - /* We include the BSD entry points here as well but we make - them weak. */ + /* We include the BSD entry points here as well. */ ENTRY (setjmp) - .weak C_SYMBOL_NAME (setjmp) - lghi %r3,1 /* Second argument of one. */ - j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ + lghi %r3,1 /* Second argument of one. */ + j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ END (setjmp) /* Binary compatibility entry point. */ ENTRY(_setjmp) - .weak C_SYMBOL_NAME (_setjmp) - slgr %r3,%r3 /* Second argument of zero. */ - j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ + slgr %r3,%r3 /* Second argument of zero. */ + j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ END (_setjmp) libc_hidden_def (_setjmp) ENTRY(__setjmp) - slgr %r3,%r3 /* Second argument of zero. */ - j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ + slgr %r3,%r3 /* Second argument of zero. */ + j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ END (__setjmp) ENTRY(__sigsetjmp) @@ -65,7 +67,7 @@ ENTRY(__sigsetjmp) PTR_MANGLE2 (%r5, %r1) stmg %r4,%r5,64(%r2) #else - stmg %r6,%r15,0(%r2) /* Store registers in jmp_buf. */ + stmg %r6,%r15,0(%r2) /* Store registers in jmp_buf. */ #endif std %f8,80(%r2) std %f9,88(%r2) @@ -80,7 +82,7 @@ ENTRY(__sigsetjmp) lghi %r2,0 br %r14 #elif defined PIC - jg __sigjmp_save@PLT /* Branch to PLT of __sigsetjmp. */ + jg __sigjmp_save@PLT /* Branch to PLT of __sigsetjmp. */ #else jg __sigjmp_save #endif @@ -91,15 +93,15 @@ END (__sigsetjmp) /* In glibc release 2.19 new versions of setjmp-functions were introduced, but were reverted before 2.20. Thus both versions are the same function. */ +# undef setjmp +# undef _setjmp # undef __sigsetjmp -weak_alias (setjmp, __v1setjmp); -weak_alias (setjmp, __v2setjmp); +strong_alias (__v1setjmp, __v2setjmp); versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0); compat_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19); -weak_alias (_setjmp, __v1_setjmp); -weak_alias (_setjmp, __v2_setjmp); +strong_alias (__v1_setjmp, __v2_setjmp); versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0); compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S index 9b477b5246..e1a97407ab 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S @@ -74,8 +74,6 @@ ENTRY(__getcontext) br %r14 END(__getcontext) -weak_alias (__getcontext, getcontext) - #if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) /* In glibc release 2.19 a new version of getcontext was introduced, but was reverted before 2.20. Thus both versions are the same function. */ @@ -83,4 +81,9 @@ weak_alias (__getcontext, __v1__getcontext) weak_alias (__getcontext, __v2__getcontext) versioned_symbol (libc, __v1__getcontext, getcontext, GLIBC_2_1) compat_symbol (libc, __v2__getcontext, getcontext, GLIBC_2_19) -#endif + +#else + +weak_alias (__getcontext, getcontext) + +#endif /* !(defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)) */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S index e781ce7af6..9a118b73af 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S @@ -74,8 +74,6 @@ ENTRY(__getcontext) br %r14 END(__getcontext) -weak_alias (__getcontext, getcontext) - #if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) /* In glibc release 2.19 a new version of getcontext was introduced, but was reverted before 2.20. Thus both versions are the same function. */ @@ -83,4 +81,9 @@ weak_alias (__getcontext, __v1__getcontext) weak_alias (__getcontext, __v2__getcontext) versioned_symbol (libc, __v1__getcontext, getcontext, GLIBC_2_1) compat_symbol (libc, __v2__getcontext, getcontext, GLIBC_2_19) -#endif + +#else + +weak_alias (__getcontext, getcontext) + +#endif /* !(defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)) */ -- cgit 1.4.1