1 /* longjmp with sp check for C-SKY ABIV2.
2 Copyright (C) 2018-2020 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <https://www.gnu.org/licenses/>. */
21 .section .rodata.str1.8,"aMS",@progbits,1
23 .type longjmp_msg,@object
25 .string "longjmp causes uninitialized stack frame"
26 .size longjmp_msg, .-longjmp_msg
29 #define __longjmp ____longjmp_chk
37 lrw t0, .Lgetpc1@GOTPC; \
39 lrw a0, longjmp_msg@GOTOFF; \
41 lrw t0, (HIDDEN_JUMPTARGET (__fortify_fail))@PLT; \
42 ldr.w t0, (gb, t0 << 0); \
48 lrw a0, longjmp_msg; \
49 jsri HIDDEN_JUMPTARGET (__fortify_fail);
52 # define CHECK_SP(reg) \
57 lrw r7, __NR_sigaltstack; \
59 subi sp, 12; /* sizeof (stack_t) */ \
81 #include <__longjmp.S>