aboutsummaryrefslogtreecommitdiff
path: root/linker/ls.ld
diff options
context:
space:
mode:
Diffstat (limited to 'linker/ls.ld')
-rw-r--r--linker/ls.ld22
1 files changed, 18 insertions, 4 deletions
diff --git a/linker/ls.ld b/linker/ls.ld
index e4cc0af..18ee181 100644
--- a/linker/ls.ld
+++ b/linker/ls.ld
@@ -7,22 +7,36 @@ MEMORY
SECTIONS
{
. = ORIGIN(flash);
+
.text : ALIGN(0x04) {
- *(.isr_vector);
- . = ALIGN(0x100);
+ *(.sinit);
+
+ /* The ch573 starts execution at address 0x0000, so we have to make sure the
+ * on_reset function is put at the beginning of the flash. */
+ *(.isr_routines.on_reset);
+
+ /* The rest of the code. */
*(.text);
} >flash AT>flash
- DATA_VALUES_IN_FLASH = LOADADDR(.data);
+ ISR_VECTOR_IN_FLASH = LOADADDR(.isr_vector);
+ .isr_vector : ALIGN(0x04) {
+ ISR_VECTOR_START = .;
+ *(.isr_vector);
+ ISR_VECTOR_STOP = .;
+ } >sram AT>flash
+ DATA_VALUES_IN_FLASH = LOADADDR(.data);
.data : ALIGN(0x04) {
. = ALIGN(0x04);
DATA_SEGMENT_START = .;
*(.data);
*(.data.*);
+ *(.sdata);
*(.rodata.*);
- DATA_SEGMENT_STOP = .;
+ *(.srodata.*);
. = ALIGN(0x04);
+ DATA_SEGMENT_STOP = .;
} >sram AT>flash
.bss : ALIGN(0x04) {