summaryrefslogtreecommitdiff
path: root/kernel/kernel.ld
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-03-25 17:36:52 -0400
committerFreya Murphy <freya@freyacat.org>2025-03-25 17:38:22 -0400
commit6af21e6a4f2251e71353562d5df7f376fdffc270 (patch)
treede20c7afc9878422c81e34f30c6b010075e9e69a /kernel/kernel.ld
downloadcomus-6af21e6a4f2251e71353562d5df7f376fdffc270.tar.gz
comus-6af21e6a4f2251e71353562d5df7f376fdffc270.tar.bz2
comus-6af21e6a4f2251e71353562d5df7f376fdffc270.zip
initial checkout from wrc
Diffstat (limited to 'kernel/kernel.ld')
-rw-r--r--kernel/kernel.ld57
1 files changed, 57 insertions, 0 deletions
diff --git a/kernel/kernel.ld b/kernel/kernel.ld
new file mode 100644
index 0000000..2007432
--- /dev/null
+++ b/kernel/kernel.ld
@@ -0,0 +1,57 @@
+/*
+** Simple linker script for the 20245 kernel.
+*/
+
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+
+SECTIONS
+{
+ /* Link the kernel at this address. */
+ /* Must match what is defined in vm.h! */
+ . = 0x80010000;
+
+ .text : AT(0x10000) {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ }
+
+ /* standard symbols */
+ PROVIDE(etext = .);
+ PROVIDE(_etext = .);
+
+ /* put read-only data next */
+ .rodata : {
+ *(.rodata .rodata.* .gnu.linkonce.r.*)
+ }
+
+ /* Align the data segment at the next page boundary */
+ /* . = ALIGN(0x1000); */
+
+ PROVIDE(data = .);
+ PROVIDE(_data = .);
+
+ /* The data segment */
+ .data : {
+ *(.data)
+ }
+
+ PROVIDE(edata = .);
+ PROVIDE(_edata = .);
+
+ /* page-align the BSS */
+ . = ALIGN(0x1000);
+
+ PROVIDE(__bss_start = .);
+
+ .bss : {
+ *(.bss)
+ }
+
+ PROVIDE(end = .);
+ PROVIDE(_end = .);
+
+ /DISCARD/ : {
+ *(.stab .stab_info .stabstr .eh_frame .note.GNU-stack .note.gnu.property .comment)
+ }
+}