OUTPUT_ARCH("riscv") ENTRY(_start) MEMORY { /* 0x0000_0000 is an alias for 0x08000_0000 */ FLASH(rwx) : ORIGIN = 0x00000000, LENGTH = 128K RAM(rw) : ORIGIN = 0x20000000, LENGTH = 32K } PHDRS { text PT_LOAD; bss PT_NULL; rodata PT_LOAD; data PT_LOAD; } SECTIONS { .text : { PROVIDE(_text_start = .); *(.text.init) *(.text .text.*) PROVIDE(_text_end = .); } >FLASH AT>FLASH :text PROVIDE(__global_pointer$ = . + 2048); .rodata : { PROVIDE(_rodata_start = .); *(.rodata .rodata.*) PROVIDE(_rodata_end = .); } >FLASH AT>FLASH :rodata . = ALIGN(4096); .data : { PROVIDE(_data_start = .); *(.sdata .sdata.*) *(.data .data.*) PROVIDE(_data_end = .); } >RAM AT>RAM :data .bss : { PROVIDE(_bss_start = .); *(.sbss .sbss.*) *(.bss .bss.*) PROVIDE(_bss_end = .); } >RAM AT>RAM :bss . = ALIGN(2); PROVIDE(_memory_start = ORIGIN(RAM)); PROVIDE(_memory_end = _memory_start + LENGTH(RAM)); PROVIDE(_stack_top = . + _memory_end); }