ENTRY(_begin) MEMORY { flash : org = 0x00000000, len = 512k sram : org = 0x20003800, len = 18k } SECTIONS { . = ORIGIN(flash); .text : ALIGN(0x04) { *(.sinit); *(.sinit.1); /* 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. */ KEEP(*(.isr_routines.on_reset)); /* The rest of the code. */ *(.text); *(.text.*); } >flash AT>flash .rodata : ALIGN(0x04) { *(.rodata); *(.rodata.*); *(.srodata); *(.srodata.*); } > flash AT>flash .clock_change_listeners : ALIGN(0x04) { CLOCK_CHANGE_LISTENERS_START = .; KEEP(*(.clock_change_listeners)); CLOCK_CHANGE_LISTENERS_END = .; } > flash AT>flash .systick_callbacks : ALIGN(0x04) { SYSTICK_LISTENERS_START = .; KEEP(*(.systick_callbacks)); SYSTICK_LISTENERS_END = .; } > flash AT>flash ISR_VECTOR_IN_FLASH = LOADADDR(.isr_vector); .isr_vector : ALIGN(0x04) { ISR_VECTOR_START = .; KEEP(*(.isr_vector)) KEEP(*(.isr_vector.routines)) ISR_VECTOR_STOP = .; } >sram AT>flash DATA_VALUES_IN_FLASH = LOADADDR(.data); .data : ALIGN(0x04) { . = ALIGN(0x04); DATA_SEGMENT_START = .; *(.data); *(.data.*); *(.sdata); *(.sdata.*); . = ALIGN(0x04); DATA_SEGMENT_STOP = .; } >sram AT>flash .bss : ALIGN(0x04) { . = ALIGN(0x04); BSS_START = .; *(.bss); *(.sbss); BSS_STOP = .; HEAP_START = .; } >sram }