summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/DynamicLoader/CMakeLists.txt5
-rw-r--r--Userland/Libraries/LibC/CMakeLists.txt7
-rw-r--r--Userland/Libraries/LibC/arch/aarch64/crti.S21
-rw-r--r--Userland/Libraries/LibC/arch/aarch64/crtn.S13
-rw-r--r--Userland/Libraries/LibC/arch/aarch64/setjmp.S15
-rw-r--r--Userland/Libraries/LibELF/Arch/aarch64/entry.S12
-rw-r--r--Userland/Libraries/LibELF/Arch/aarch64/plt_trampoline.S13
7 files changed, 84 insertions, 2 deletions
diff --git a/Userland/DynamicLoader/CMakeLists.txt b/Userland/DynamicLoader/CMakeLists.txt
index baa0829862..1e4e3ad764 100644
--- a/Userland/DynamicLoader/CMakeLists.txt
+++ b/Userland/DynamicLoader/CMakeLists.txt
@@ -8,7 +8,10 @@ file(GLOB ELF_SOURCES "../Libraries/LibELF/*.cpp")
file(GLOB LIBC_SOURCES1 "../Libraries/LibC/*.cpp")
file(GLOB LIBC_SOURCES2 "../Libraries/LibC/*/*.cpp")
-if ("${SERENITY_ARCH}" STREQUAL "i686")
+if ("${SERENITY_ARCH}" STREQUAL "aarch64")
+ file(GLOB LIBC_SOURCES3 "../Libraries/LibC/arch/aarch64/*.S")
+ set(ELF_SOURCES ${ELF_SOURCES} ../Libraries/LibELF/Arch/aarch64/entry.S ../Libraries/LibELF/Arch/aarch64/plt_trampoline.S)
+elseif ("${SERENITY_ARCH}" STREQUAL "i686")
file(GLOB LIBC_SOURCES3 "../Libraries/LibC/arch/i386/*.S")
set(ELF_SOURCES ${ELF_SOURCES} ../Libraries/LibELF/Arch/i386/entry.S ../Libraries/LibELF/Arch/i386/plt_trampoline.S)
elseif ("${SERENITY_ARCH}" STREQUAL "x86_64")
diff --git a/Userland/Libraries/LibC/CMakeLists.txt b/Userland/Libraries/LibC/CMakeLists.txt
index 1022ec944c..5ad420f047 100644
--- a/Userland/Libraries/LibC/CMakeLists.txt
+++ b/Userland/Libraries/LibC/CMakeLists.txt
@@ -67,7 +67,12 @@ set(LIBC_SOURCES
file(GLOB AK_SOURCES CONFIGURE_DEPENDS "../../../AK/*.cpp")
file(GLOB ELF_SOURCES CONFIGURE_DEPENDS "../LibELF/*.cpp")
-if ("${SERENITY_ARCH}" STREQUAL "i686")
+if ("${SERENITY_ARCH}" STREQUAL "aarch64")
+ set(ASM_SOURCES "arch/aarch64/setjmp.S")
+ set(ELF_SOURCES ${ELF_SOURCES} ../LibELF/Arch/aarch64/entry.S ../LibELF/Arch/aarch64/plt_trampoline.S)
+ set(CRTI_SOURCE "arch/aarch64/crti.S")
+ set(CRTN_SOURCE "arch/aarch64/crtn.S")
+elseif ("${SERENITY_ARCH}" STREQUAL "i686")
set(ASM_SOURCES "arch/i386/setjmp.S")
set(ELF_SOURCES ${ELF_SOURCES} ../LibELF/Arch/i386/entry.S ../LibELF/Arch/i386/plt_trampoline.S)
set(CRTI_SOURCE "arch/i386/crti.S")
diff --git a/Userland/Libraries/LibC/arch/aarch64/crti.S b/Userland/Libraries/LibC/arch/aarch64/crti.S
new file mode 100644
index 0000000000..660ba90bf6
--- /dev/null
+++ b/Userland/Libraries/LibC/arch/aarch64/crti.S
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2021, Nico Weber <thakis@chromium.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+.section .init, "ax", @progbits
+.p2align 2
+.global _init
+.type _init, @function
+_init:
+ # FIXME: Possibly incomplete.
+ ret
+
+.section .fini, "ax", @progbits
+.p2align 4
+.global _fini
+.type _fini, @function
+_fini:
+ # FIXME: Possibly incomplete.
+ ret
diff --git a/Userland/Libraries/LibC/arch/aarch64/crtn.S b/Userland/Libraries/LibC/arch/aarch64/crtn.S
new file mode 100644
index 0000000000..aea4d4d133
--- /dev/null
+++ b/Userland/Libraries/LibC/arch/aarch64/crtn.S
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2021, Nico Weber <thakis@chromium.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+.section .init, "ax", @progbits
+ # FIXME: Possibly incomplete.
+ ret
+
+.section .fini, "ax", @progbits
+ # FIXME: Possibly incomplete.
+ ret
diff --git a/Userland/Libraries/LibC/arch/aarch64/setjmp.S b/Userland/Libraries/LibC/arch/aarch64/setjmp.S
new file mode 100644
index 0000000000..6ae11c4151
--- /dev/null
+++ b/Userland/Libraries/LibC/arch/aarch64/setjmp.S
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2021, Nico Weber <thakis@chromium.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+.global setjmp
+setjmp:
+ # FIXME: Possibly incomplete.
+ ret
+
+.global longjmp
+longjmp:
+ # FIXME: Possibly incomplete.
+ ret
diff --git a/Userland/Libraries/LibELF/Arch/aarch64/entry.S b/Userland/Libraries/LibELF/Arch/aarch64/entry.S
new file mode 100644
index 0000000000..2e9620e498
--- /dev/null
+++ b/Userland/Libraries/LibELF/Arch/aarch64/entry.S
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2021, Nico Weber <thakis@chromium.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+.globl _invoke_entry
+.hidden _invoke_entry
+.type _invoke_entry,@function
+_invoke_entry: # (argc, argv, envp, entry)
+ # FIXME: Possibly incomplete.
+ ret
diff --git a/Userland/Libraries/LibELF/Arch/aarch64/plt_trampoline.S b/Userland/Libraries/LibELF/Arch/aarch64/plt_trampoline.S
new file mode 100644
index 0000000000..016266f2c8
--- /dev/null
+++ b/Userland/Libraries/LibELF/Arch/aarch64/plt_trampoline.S
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2021, Nico Weber <thakis@chromium.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+.p2align 4
+.globl _plt_trampoline
+.hidden _plt_trampoline
+.type _plt_trampoline,@function
+_plt_trampoline: # (object, relocation_index)
+ # FIXME: Possibly incomplete.
+ ret