wires

summary refs log tree commit diff
path: root/src/Link.ld
diff options
context:
space:
mode:
authorwires <wires@noreply.wires.systems>2025-03-19 17:09:41 -0400
committerwires <wires@noreply.wires.systems>2025-03-19 17:09:41 -0400
commit8466e9b4d2fbca85d53d8dadc87914b4766c43de (patch)
tree99a0d7a23e805f4ad3e30814ee9a09ebb00ae08b /src/Link.ld
downloadzosimos-8466e9b4d2fbca85d53d8dadc87914b4766c43de.tar.gz
initial commit
Diffstat (limited to 'src/Link.ld')
-rw-r--r--src/Link.ld35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Link.ld b/src/Link.ld
new file mode 100644
index 0000000..aec6d6a
--- /dev/null
+++ b/src/Link.ld
@@ -0,0 +1,35 @@
+ENTRY(_start)
+OUTPUT_FORMAT("elf64-littleaarch64")
+
+SECTIONS {
+  __kernel_load_address = 0x80000;
+  __stack_base = __kernel_load_address;
+
+  . = __kernel_load_address;
+
+  .init : {
+    KEEP(*(.init))
+  }
+
+  .text : {
+    *(.text)
+    *(.text.*)
+    *(.gnu.linkonce.t*)
+  }
+
+  . = ALIGN(CONSTANT(MAXPAGESIZE));
+  __bss_start = .;
+  .bss (NOLOAD) : {
+    *(.bss*)
+    *(.gnu.linkonce.b*)
+    *(COMMON)
+  }
+  __bss_end = .;
+  __bss_size = (__bss_end - __bss_start) / 8;
+
+  . = ALIGN(CONSTANT(COMMONPAGESIZE));
+  .rodata : { *(.rodata*) *(.gnu.linkonce.d*) }
+
+  . = ALIGN(CONSTANT(COMMONPAGESIZE));
+  .data : { *(.data*) *(.gnu.linkonce.d*) }
+}