From f06e0279a51f308b71b56228e038c8c17a97ceaa Mon Sep 17 00:00:00 2001 From: David Karoly Date: Fri, 18 Feb 2022 17:46:29 +0100 Subject: [PATCH] implement glue for arm Change-Id: I2752fb8b1c8843e8344a10295caf82e9603ed5e2 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4973 Tested-by: Commit checker robot Reviewed-by: Fredrik Holmqvist --- src/system/glue/arch/arm/crti.S | 9 +++++++-- src/system/glue/arch/arm/crtn.S | 12 +++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/system/glue/arch/arm/crti.S b/src/system/glue/arch/arm/crti.S index 680b4f24a5..af9f5aac19 100644 --- a/src/system/glue/arch/arm/crti.S +++ b/src/system/glue/arch/arm/crti.S @@ -1,4 +1,7 @@ /* + * Copyright 2022, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -21,8 +24,10 @@ .section .init FUNCTION(_init): - // crtbegin.o stuff comes here + sub sp, sp, #8 + str lr, [sp] .section .fini FUNCTION(_fini): - // crtbegin.o stuff comes here + sub sp, sp, #8 + str lr, [sp] diff --git a/src/system/glue/arch/arm/crtn.S b/src/system/glue/arch/arm/crtn.S index 48e3dc6170..68556edccc 100644 --- a/src/system/glue/arch/arm/crtn.S +++ b/src/system/glue/arch/arm/crtn.S @@ -1,4 +1,7 @@ /* + * Copyright 2022, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -9,9 +12,12 @@ */ .section .init - // the image ID and program args are still on the stack - + ldr lr, [sp] + add sp, sp, #8 + bx lr .section .fini - // the image ID and program args are still on the stack + ldr lr, [sp] + add sp, sp, #8 + bx lr