diff options
| author | taitep <taitep@taitep.se> | 2025-12-21 19:38:32 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-21 19:38:32 +0100 |
| commit | a2d4dec4176d9ef89a8f411dbb3503c217ba0d62 (patch) | |
| tree | eaf0b14f27903792ff3f305be4b4d0829586995c /link.ld | |
| parent | 6c39a5eef270e160f9954dc8eac99ce53e8423c9 (diff) | |
Add some stuff to help with using C in link.ld
Diffstat (limited to 'link.ld')
| -rw-r--r-- | link.ld | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -1,22 +1,31 @@ ENTRY(_start) -SECTIONS { - . = 0x80000000; +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); } |
