Enable no-exec stacks for more targets using the Linux kernel.
[official-gcc.git] / libgcc / config / microblaze / stack_overflow_exit.S
blob5f6be94e07a0ea2b98eb94ae106b588639b37016
1 ###################################-*-asm*- 
2
3 #    Copyright (C) 2009-2017 Free Software Foundation, Inc.
4
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
11 #  later version.
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/>.  
26
27 #  stack_overflow_exit.S
28
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
33
34 #######################################
36 /* An executable stack is *not* required for these functions.  */
37 #ifdef __linux__
38 .section .note.GNU-stack,"",%progbits
39 .previous
40 #endif
42         .globl  _stack_overflow_error
43         .data
44         .align  2
45         .type   _stack_overflow_error,@object
46         .size   _stack_overflow_error,4
47 _stack_overflow_error:
48         .data32 0
50         .text 
51         .globl  _stack_overflow_exit    
52         .ent    _stack_overflow_exit
53         .type   _stack_overflow_exit,@function
55 _stack_overflow_exit:
56 #ifdef __PIC__
57         mfs     r20,rpc
58         addik   r20,r20,_GLOBAL_OFFSET_TABLE_+8
59         swi     r1,r20,_stack_overflow_error@GOTOFF
60         bri     exit@PLT
61 #else
62         swi     r1,r0,_stack_overflow_error
63         bri     exit
64 #endif
66         .end    _stack_overflow_exit
67         .size   _stack_overflow_exit,. - _stack_overflow_exit