1/* 2 Copyright 2019, Adrien Destugues <pulkomandy@pulkomandy.tk> 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7/** This file contains the first part of the ".init" and ".fini" sections in 8 * the ELF executable. 9 * The functions defined here will be called during initialization/termination 10 * of the loaded executable/library. The ".init" and ".fini" sections are 11 * stacked together like this: 12 * 13 * crti.S entry point 14 * crtbegin.S GCC specific: constructors/destructors are called, ... 15 * crtend.S 16 * crtn.S call to _init_after/_term_after 17 * exit 18 */ 19 20 21.section .init 22.global _init 23.type _init, #function 24 // crtbegin.o stuff comes here 25 26.section .fini 27.global _fini 28.type _fini, #function 29 // crtend.o stuff comes here 30