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