1/*
2 * Copyright 2022, Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Copyright 2005, Axel D��rfler, axeld@pinc-software.de.
6 * Distributed under the terms of the MIT License.
7 */
8
9/**	This file contains the first part of the ".init" and ".fini" sections in
10 *	the ELF executable.
11 *	The functions defined here will be called during initialization/termination
12 *	of the loaded executable/library. The ".init" and ".fini" sections are
13 *	stacked together like this:
14 *
15 *	crti.S		entry point
16 *				call to _init_before/_term_before
17 *	crtbegin.S	GCC specific: constructors/destructors are called, ...
18 *	crtend.S
19 *	crtn.S		call to _init_after/_term_after
20 *				exit
21 */
22
23#define FUNCTION(x) .global x; .type x,%function; x
24
25.section .init
26FUNCTION(_init):
27	sub		sp, sp, #8
28	str		lr, [sp]
29
30.section .fini
31FUNCTION(_fini):
32	sub		sp, sp, #8
33	str		lr, [sp]
34