summaryrefslogtreecommitdiff
path: root/link.ld
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-24 11:42:55 +0100
committertaitep <taitep@taitep.se>2025-12-24 11:42:55 +0100
commit3f789442c0be7d0222209d98dde21efcff7602d0 (patch)
tree51c6b6efb2d007b40b9149fc7d2ca7e3fd9334f1 /link.ld
parent96c2cbf7ae79d1956d0e03812e2521667711d684 (diff)
some linker script updates to work even more properly for newlib i think
Diffstat (limited to 'link.ld')
-rw-r--r--link.ld24
1 files changed, 20 insertions, 4 deletions
diff --git a/link.ld b/link.ld
index 0e43104..49cdbe0 100644
--- a/link.ld
+++ b/link.ld
@@ -14,17 +14,33 @@ SECTIONS {
} > RAM
.data : ALIGN(8) {
- _data = .;
+ _data_start = .;
*(.data*)
- _edata = .;
+ _data_end = .;
} > RAM
.bss : ALIGN(8) {
- _bss = .;
+ _bss_start = .;
*(.bss*)
*(COMMON)
- _ebss = .;
+ _bss_end = .;
} > RAM
+ .sdata : ALIGN(8) {
+ _sdata_start = .;
+ *(.sdata*)
+ _sdata_end = .;
+ } > RAM
+
+ .sbss : ALIGN(8) {
+ _sbss_start = .;
+ *(.sbss*)
+ _sbss_end = .;
+ } > RAM
+
+ __global_pointer$ = _sdata_start + ((_sdata_end - _sdata_start + _sbss_end - _sbss_start) / 2);
+
+ _heap_start = ALIGN(8);
+
_stack_top = ORIGIN(RAM) + LENGTH(RAM);
}