Add some stuff to help with using C in link.ld

This commit is contained in:
2025-12-21 19:38:32 +01:00
parent 6c39a5eef2
commit a2d4dec417

25
link.ld
View File

@@ -1,22 +1,31 @@
ENTRY(_start)
SECTIONS {
. = 0x80000000;
.text : ALIGN(4) {
*(.text*)
MEMORY {
RAM (rwx) : ORIGIN = 0x80000000, LENGTH = 1M
}
SECTIONS {
.text : ALIGN(4) {
*(.text._start)
*(.text*)
} > RAM
.rodata : ALIGN(8) {
*(.rodata*)
}
} > RAM
.data : ALIGN(8) {
_data = .;
*(.data*)
}
_edata = .;
} > RAM
.bss : ALIGN(8) {
_bss = .;
*(.bss*)
*(COMMON)
}
_ebss = .;
} > RAM
_stack_top = ORIGIN(RAM) + LENGTH(RAM);
}