/* BASIC: code and constants below A000h (ROM_TOP: the hardware ignores writes there), the program area at A000h, then data. 12000h-12FFFh is left free for machine code; the stack comes down from 13FF0h; 13FF8h-13FFFh hold the clock (include/basys3.h). */ OUTPUT_ARCH("riscv") ENTRY(_start) MEMORY { ROM (rx) : ORIGIN = 0x00000, LENGTH = 0xA000 RAM (rw) : ORIGIN = 0x0A000, LENGTH = 0x8000 } SECTIONS { .text : { KEEP(*(.text.start)) *(.text .text.*) *(.rodata .rodata.* .srodata .srodata.*) . = ALIGN(4); } > ROM .arena (NOLOAD) : { KEEP(*(.arena)) } > RAM .data : ALIGN(4) { __data_start = .; *(.data .data.*) __global_pointer$ = . + 0x800; *(.sdata .sdata.*) . = ALIGN(4); __data_end = .; } > RAM AT > ROM __data_load = LOADADDR(.data); .bss (NOLOAD) : ALIGN(4) { __bss_start = .; *(.sbss .sbss.* .bss .bss.* COMMON) . = ALIGN(4); __bss_end = .; } > RAM ASSERT(__bss_end <= 0x12000, "BASIC's data runs into the machine-code area") __stack_top = 0x13FF0; __rom_end = __data_load + SIZEOF(.data); /DISCARD/ : { *(.comment) *(.riscv.attributes) } }