glue: Add code for ARM64

This allows ARM64 to bootstrap for building of GCC.

Signed-off-by: Jaroslaw Pelczar <[email protected]>
Change-Id: Ia2ea34d1fc1a8e4d3c77a7ef05a32a8603a4fb51
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1851
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Jaroslaw Pelczar
2019-10-09 01:01:51 +00:00
committed by waddlesplash
parent 9a84f57b3f
commit 3e08219154
2 changed files with 19 additions and 18 deletions
+10 -6
View File
@@ -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]
+9 -12
View File
@@ -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