1 /* setjmp for 64 bit S/390, ELF version.
2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
23 #include <bits/setjmp.h>
24 #include <shlib-compat.h>
25 #include <stap-probe.h>
27 #if !IS_IN (rtld) && defined SHARED \
28 && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
29 # define NEED_COMPAT_SYMBOLS 1
30 /* We need a unique name in case of symbol versioning. */
31 # define setjmp __v1setjmp
32 # define _setjmp __v1_setjmp
33 # define __sigsetjmp __v1__sigsetjmp
35 # define NEED_COMPAT_SYMBOLS 0
38 /* We include the BSD entry points here as well. */
40 lghi %r3,1 /* Second argument of one. */
41 j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
44 /* Binary compatibility entry point. */
46 slgr %r3,%r3 /* Second argument of zero. */
47 j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
49 #if NEED_COMPAT_SYMBOLS
50 strong_alias (_setjmp, __GI__setjmp)
52 libc_hidden_def (_setjmp)
56 slgr %r3,%r3 /* Second argument of zero. */
57 j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
62 /* setjmp probe expects sig/setjmp first argument (8@%r2), second
63 argument (-8@%r3) and target address (8@%r14). */
64 LIBC_PROBE (setjmp, 3, 8@%r2, -4@%r3, 8@%r14)
66 stmg %r6,%r13,0(%r2) /* Store registers in jmp_buf. */
70 PTR_MANGLE2 (%r5, %r1)
73 stmg %r6,%r15,0(%r2) /* Store registers in jmp_buf. */
84 /* In ld.so we never save the signal mask. */
88 jg __sigjmp_save@PLT /* Branch to PLT of __sigsetjmp. */
93 #if NEED_COMPAT_SYMBOLS
94 strong_alias (__sigsetjmp, __GI___sigsetjmp)
96 libc_hidden_def (__sigsetjmp)
99 #if NEED_COMPAT_SYMBOLS
100 /* In glibc release 2.19 new versions of setjmp-functions were introduced,
101 but were reverted before 2.20. Thus both versions are the same function. */
107 strong_alias (__v1setjmp, __v2setjmp);
108 versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0);
109 compat_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19);
111 strong_alias (__v1_setjmp, __v2_setjmp);
112 versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0);
113 compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19);
115 strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
116 versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
117 compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
118 #endif /* NEED_COMPAT_SYMBOLS */