1 /* setjmp for s390, ELF version.
2 Copyright (C) 2000-2014 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>
28 # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
29 /* we need a unique name in case of symbol versioning. */
30 # define __sigsetjmp __v1__sigsetjmp
31 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */
32 #endif /* !IS_IN (rtld) */
34 /* We include the BSD entry points here as well but we make
37 .weak C_SYMBOL_NAME (setjmp)
38 lhi %r3,1 /* second argument of one */
39 j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
42 /* Binary compatibility entry point. */
44 .weak C_SYMBOL_NAME (_setjmp)
45 lhi %r3,0 /* second argument of zero */
46 j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
48 libc_hidden_def (_setjmp)
51 lhi %r3,0 /* second argument of zero */
52 j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
57 /* setjmp probe expects sig/setjmp first argument (4@%r2), second
58 argument (-4@%r3) and target address (4@%r14). */
59 LIBC_PROBE (setjmp, 3, 4@%r2, -4@%r3, 4@%r14)
61 stm %r6,%r13,0(%r2) /* store registers in jmp_buf */
65 PTR_MANGLE2 (%r5, %r1)
68 stm %r6,%r15,0(%r2) /* store registers in jmp_buf */
73 /* In ld.so we never save the signal mask. */
77 /* We cannot use the PLT, because it requires that %r12 be set, but
78 we can't save and restore our caller's value. Instead, we do an
79 indirect jump through the GOT. */
81 .L0: al %r1,.L1 - .L0(0,%r1) /* get address of global offset table */
82 /* get address of __sigjmp_save from got */
83 l %r1,__sigjmp_save@GOT(%r1)
85 .L1: .long _GLOBAL_OFFSET_TABLE_ - .L0
88 .L0: l %r1,.L1-.L0(0,%r1) /* load address of __sigjmp_save */
89 br %r1 /* tail-call __sigjmp_save */
90 .L1: .long __sigjmp_save
95 # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
96 /* In glibc release 2.19 new versions of setjmp-functions were introduced,
97 but were reverted before 2.20. Thus both versions are the same function. */
101 weak_alias (setjmp, __v1setjmp);
102 weak_alias (setjmp, __v2setjmp);
103 versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0);
104 compat_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19);
106 weak_alias (_setjmp, __v1_setjmp);
107 weak_alias (_setjmp, __v2_setjmp);
108 versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0);
109 compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19);
111 strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
112 versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
113 compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
114 # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */
115 #endif /* if !IS_IN (rtld) */