mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
171f793c1e
Unfortunately, the .rodata section can't be stored in flash. Instead, an explicit .progmem section should be used, which is supported in LLVM as address space 1 but not exposed to normal programs. Eventually a pass should be written that converts trivial const globals of which all loads are visible to be in addrspace 1, to get the benefits of storing those globals directly in ROM.
53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
|
|
MEMORY
|
|
{
|
|
FLASH_TEXT (rw) : ORIGIN = 0, LENGTH = __flash_size - _bootloader_size
|
|
RAM (xrw) : ORIGIN = 0x800000 + __ram_start, LENGTH = __ram_size
|
|
}
|
|
|
|
SECTIONS
|
|
{
|
|
.text :
|
|
{
|
|
KEEP(*(.vectors))
|
|
KEEP(*(.text.__vector_RESET))
|
|
KEEP(*(.text.main)) /* main must follow the reset handler */
|
|
*(.text.*)
|
|
*(.progmem)
|
|
*(.progmem.*)
|
|
}
|
|
|
|
.stack (NOLOAD) :
|
|
{
|
|
. += _stack_size;
|
|
_stack_top = .;
|
|
} >RAM
|
|
|
|
_sidata = LOADADDR(.data);
|
|
|
|
.data :
|
|
{
|
|
_sdata = .; /* used by startup code */
|
|
*(.rodata)
|
|
*(.rodata.*)
|
|
*(.data)
|
|
*(.data*)
|
|
_edata = .; /* used by startup code */
|
|
} >RAM AT>FLASH_TEXT
|
|
|
|
.bss :
|
|
{
|
|
_sbss = .; /* used by startup code */
|
|
*(.bss)
|
|
*(.bss*)
|
|
*(COMMON)
|
|
_ebss = .; /* used by startup code */
|
|
} >RAM
|
|
}
|
|
|
|
/* For the memory allocator. */
|
|
_heap_start = _ebss;
|
|
_heap_end = ORIGIN(RAM) + LENGTH(RAM);
|
|
_globals_start = _sdata;
|
|
_globals_end = _ebss;
|