1*ec02198aSmrg# Copyright (C) 2001-2020 Free Software Foundation, Inc. 210d565efSmrg# Written By Nick Clifton 310d565efSmrg# 410d565efSmrg# This file is free software; you can redistribute it and/or modify it 510d565efSmrg# under the terms of the GNU General Public License as published by the 610d565efSmrg# Free Software Foundation; either version 3, or (at your option) any 710d565efSmrg# later version. 810d565efSmrg# 910d565efSmrg# This file is distributed in the hope that it will be useful, but 1010d565efSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1110d565efSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1210d565efSmrg# General Public License for more details. 1310d565efSmrg# 1410d565efSmrg# Under Section 7 of GPL version 3, you are granted additional 1510d565efSmrg# permissions described in the GCC Runtime Library Exception, version 1610d565efSmrg# 3.1, as published by the Free Software Foundation. 1710d565efSmrg# 1810d565efSmrg# You should have received a copy of the GNU General Public License and 1910d565efSmrg# a copy of the GCC Runtime Library Exception along with this program; 2010d565efSmrg# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 2110d565efSmrg# <http://www.gnu.org/licenses/>. 2210d565efSmrg 2310d565efSmrg/* An executable stack is *not* required for these functions. */ 2410d565efSmrg#if defined(__ELF__) && defined(__linux__) 2510d565efSmrg.section .note.GNU-stack,"",%progbits 2610d565efSmrg.previous 2710d565efSmrg#endif 2810d565efSmrg 2910d565efSmrg# This file just make a stack frame for the contents of the .fini and 3010d565efSmrg# .init sections. Users may put any desired instructions in those 3110d565efSmrg# sections. 3210d565efSmrg 3310d565efSmrg#ifdef __ELF__ 3410d565efSmrg#define TYPE(x) .type x,function 3510d565efSmrg#else 3610d565efSmrg#define TYPE(x) 3710d565efSmrg#endif 3810d565efSmrg#ifdef __ARM_EABI__ 3910d565efSmrg/* Some attributes that are common to all routines in this file. */ 4010d565efSmrg /* Tag_ABI_align_needed: This code does not require 8-byte 4110d565efSmrg alignment from the caller. */ 4210d565efSmrg /* .eabi_attribute 24, 0 -- default setting. */ 4310d565efSmrg /* Tag_ABI_align_preserved: This code preserves 8-byte 4410d565efSmrg alignment in any callee. */ 4510d565efSmrg .eabi_attribute 25, 1 4610d565efSmrg#endif /* __ARM_EABI__ */ 4710d565efSmrg 4810d565efSmrg # Note - this macro is complemented by the FUNC_END macro 4910d565efSmrg # in crtn.S. If you change this macro you must also change 5010d565efSmrg # that macro match. 5110d565efSmrg.macro FUNC_START 5210d565efSmrg#ifdef __thumb__ 5310d565efSmrg .thumb 5410d565efSmrg 5510d565efSmrg push {r3, r4, r5, r6, r7, lr} 5610d565efSmrg#else 5710d565efSmrg .arm 5810d565efSmrg # Create a stack frame and save any call-preserved registers 5910d565efSmrg mov ip, sp 6010d565efSmrg stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc} 6110d565efSmrg sub fp, ip, #4 6210d565efSmrg#endif 6310d565efSmrg.endm 6410d565efSmrg 6510d565efSmrg .section ".init" 6610d565efSmrg .align 2 6710d565efSmrg .global _init 6810d565efSmrg#ifdef __thumb__ 6910d565efSmrg .thumb_func 7010d565efSmrg#endif 7110d565efSmrg TYPE(_init) 7210d565efSmrg_init: 7310d565efSmrg FUNC_START 7410d565efSmrg 7510d565efSmrg 7610d565efSmrg .section ".fini" 7710d565efSmrg .align 2 7810d565efSmrg .global _fini 7910d565efSmrg#ifdef __thumb__ 8010d565efSmrg .thumb_func 8110d565efSmrg#endif 8210d565efSmrg TYPE(_fini) 8310d565efSmrg_fini: 8410d565efSmrg FUNC_START 8510d565efSmrg 8610d565efSmrg# end of crti.S 87