1 /* Copyright (C) 2009-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
20 #include <sigaltstack-offsets.h>
22 .section .rodata.str1.1,"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 cfi_adjust_cfa_offset (4); \
38 cfi_rel_offset (r12, 0); \
43 cfi_adjust_cfa_offset (4); \
44 cfi_rel_offset (pr, 0); \
51 .long _GLOBAL_OFFSET_TABLE_; \
53 .long longjmp_msg@GOTOFF; \
55 .long __GI___fortify_fail@PLT-(.Lfail0-.); \
63 cfi_adjust_cfa_offset (4); \
64 cfi_rel_offset (pr, 0); \
72 .long __fortify_fail; \
76 #define CHECK_SP(reg) \
77 /* Jumping to a higher-address frame is always allowed. */ \
81 mov.l r0, @-r15; /* The return value is already in here. */ \
82 cfi_adjust_cfa_offset (4); \
83 mov.l r1, @-r15; /* PTR_DEMANGLE helper. */ \
84 cfi_adjust_cfa_offset (4); \
85 mov.l r2, @-r15; /* The new SP value is already in here. */ \
86 cfi_adjust_cfa_offset (4); \
87 mov.l r4, @-r15; /* We'll still need this one. */ \
88 cfi_adjust_cfa_offset (4); \
90 cfi_adjust_cfa_offset (sizeSS); \
93 DO_CALL (sigaltstack, 2); \
94 /* Without working sigaltstack we cannot perform the test. */ \
97 mov.l @(oSS_FLAGS, r15), r0; \
98 tst #SS_ONSTACK, r0; \
100 mov.l @(oSS_SIZE, r15), r2; \
101 mov.l @(oSS_SP, r15), r1; \
111 cfi_adjust_cfa_offset (-sizeSS); \
113 cfi_adjust_cfa_offset (-4); \
115 cfi_adjust_cfa_offset (-4); \
117 cfi_adjust_cfa_offset (-4); \
119 cfi_adjust_cfa_offset (-4); \
122 #include <__longjmp.S>