15f119ed7SAlex Smith/* 25f119ed7SAlex Smith * Copyright 2005-2006, Axel Dörfler, axeld@pinc-software.de. 35f119ed7SAlex Smith * Copyright 2012, Alex Smith, alex@alex-smith.me.uk. 45f119ed7SAlex Smith * Distributed under the terms of the MIT License. 55f119ed7SAlex Smith */ 65f119ed7SAlex Smith 75f119ed7SAlex Smith 85f119ed7SAlex Smith/** This file contains the final part of the ".init" and ".fini" sections in 95f119ed7SAlex Smith * the ELF executable. It is tightly connected to crti.S. 105f119ed7SAlex Smith * Have a look at crti.S to find a description of what happens here. 115f119ed7SAlex Smith */ 125f119ed7SAlex Smith 135f119ed7SAlex Smith 145f119ed7SAlex Smith.section .init 155f119ed7SAlex Smith // The image ID is preserved on the stack. 16874e9521SSimon South add $0x8, %rsp 175f119ed7SAlex Smith pop %rdi 18*354b60afSAugustin Cavalier 195f119ed7SAlex Smith movq %rbp, %rsp 205f119ed7SAlex Smith pop %rbp 215f119ed7SAlex Smith ret 225f119ed7SAlex Smith 235f119ed7SAlex Smith.section .fini 24874e9521SSimon South add $0x8, %rsp 255f119ed7SAlex Smith pop %rdi 26*354b60afSAugustin Cavalier 275f119ed7SAlex Smith movq %rbp, %rsp 285f119ed7SAlex Smith pop %rbp 295f119ed7SAlex Smith ret 30