xref: /haiku/src/system/glue/arch/arm/crti.S (revision 46b7da1f4f40f7157d74fc7fb26ff9ec7f2416f2)
157c324a7SJerome Duval/*
2*f06e0279SDavid Karoly * Copyright 2022, Haiku Inc. All rights reserved.
3*f06e0279SDavid Karoly * Distributed under the terms of the MIT License.
4*f06e0279SDavid Karoly *
557c324a7SJerome Duval * Copyright 2005, Axel Dörfler, axeld@pinc-software.de.
657c324a7SJerome Duval * Distributed under the terms of the MIT License.
757c324a7SJerome Duval */
857c324a7SJerome Duval
957c324a7SJerome Duval/**	This file contains the first part of the ".init" and ".fini" sections in
1057c324a7SJerome Duval *	the ELF executable.
1157c324a7SJerome Duval *	The functions defined here will be called during initialization/termination
1257c324a7SJerome Duval *	of the loaded executable/library. The ".init" and ".fini" sections are
1357c324a7SJerome Duval *	stacked together like this:
1457c324a7SJerome Duval *
1557c324a7SJerome Duval *	crti.S		entry point
1657c324a7SJerome Duval *				call to _init_before/_term_before
1757c324a7SJerome Duval *	crtbegin.S	GCC specific: constructors/destructors are called, ...
1857c324a7SJerome Duval *	crtend.S
1957c324a7SJerome Duval *	crtn.S		call to _init_after/_term_after
2057c324a7SJerome Duval *				exit
2157c324a7SJerome Duval */
2257c324a7SJerome Duval
2357c324a7SJerome Duval#define FUNCTION(x) .global x; .type x,%function; x
2457c324a7SJerome Duval
2557c324a7SJerome Duval.section .init
2657c324a7SJerome DuvalFUNCTION(_init):
27*f06e0279SDavid Karoly	sub		sp, sp, #8
28*f06e0279SDavid Karoly	str		lr, [sp]
2957c324a7SJerome Duval
3057c324a7SJerome Duval.section .fini
3157c324a7SJerome DuvalFUNCTION(_fini):
32*f06e0279SDavid Karoly	sub		sp, sp, #8
33*f06e0279SDavid Karoly	str		lr, [sp]
34