1 ###################################-*-asm*-
3 # Copyright (C) 2009-2017 Free Software Foundation, Inc.
6 # Contributed by Michael Eager <eager@eagercon.com>.
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by the
10 # Free Software Foundation; either version 3, or (at your option) any
13 # GCC is distributed in the hope that it will be useful, but WITHOUT
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 # License for more details.
18 # Under Section 7 of GPL version 3, you are granted additional
19 # permissions described in the GCC Runtime Library Exception, version
20 # 3.1, as published by the Free Software Foundation.
22 # You should have received a copy of the GNU General Public License and
23 # a copy of the GCC Runtime Library Exception along with this program;
24 # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 # <http://www.gnu.org/licenses/>.
27 # stack_overflow_exit.S
29 # Checks for stack overflows and sets the global variable
30 # stack_overflow_error with the value of current stack pointer
32 # This routine exits from the program
34 #######################################
36 /* An executable stack is *not* required for these functions. */
38 .section .note.GNU-stack,"",%progbits
42 .globl _stack_overflow_error
45 .type _stack_overflow_error,@object
46 .size _stack_overflow_error,4
47 _stack_overflow_error:
51 .globl _stack_overflow_exit
52 .ent _stack_overflow_exit
53 .type _stack_overflow_exit,@function
58 addik r20,r20,_GLOBAL_OFFSET_TABLE_+8
59 swi r1,r20,_stack_overflow_error@GOTOFF
62 swi r1,r0,_stack_overflow_error
66 .end _stack_overflow_exit
67 .size _stack_overflow_exit,. - _stack_overflow_exit