diff --git a/src/system/glue/arch/arm64/crti.S b/src/system/glue/arch/arm64/crti.S index 680b4f24a5..b95f2d7131 100644 --- a/src/system/glue/arch/arm64/crti.S +++ b/src/system/glue/arch/arm64/crti.S @@ -1,5 +1,5 @@ /* - * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2019 Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ @@ -17,12 +17,16 @@ * exit */ -#define FUNCTION(x) .global x; .type x,%function; x +#define FUNCTION(x) .globl x; .type _init, %function; x -.section .init +.section .init, "ax", @progbits +.p2align 16 FUNCTION(_init): - // crtbegin.o stuff comes here + sub sp, sp, #16 + str lr, [sp] -.section .fini +.section .fini, "ax", @progbits +.p2align 16 FUNCTION(_fini): - // crtbegin.o stuff comes here + sub sp, sp, #16 + str lr, [sp] diff --git a/src/system/glue/arch/arm64/crtn.S b/src/system/glue/arch/arm64/crtn.S index 48e3dc6170..eb2822a280 100644 --- a/src/system/glue/arch/arm64/crtn.S +++ b/src/system/glue/arch/arm64/crtn.S @@ -1,17 +1,14 @@ /* - * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2019 Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ -/** This file contains the final part of the ".init" and ".fini" sections in - * the ELF executable. It is tightly connected to crti.S. - * Have a look at crti.S to find a description of what happens here. - */ - -.section .init - // the image ID and program args are still on the stack - - -.section .fini - // the image ID and program args are still on the stack +.section .init, "ax", @progbits + ldr lr, [sp] + add sp, sp, #16 + ret +.section .fini, "ax", @progbits + ldr lr, [sp] + add sp, sp, #16 + ret