tinygo/targets/avr.ld
Ayke van Laethem 213a6240a1 avr: move data address space to 0x800000
This convention is followed by most of the avr-gcc toolchain but older
versions of binutils don't mind overlapping program/data spaces.
However, newer versions start complaining about an overlap in address
space:

    avr-ld: section .stack VMA [0000000000000100,00000000000002ff] overlaps section .text VMA [0000000000000000,0000000000000225]

This commit moves the data space in the linker script to 0x800000, like
the rest of the toolchain does.
2020-03-20 15:12:38 +01:00

50 строки
1 КиБ
Text

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.*)
*(.rodata)
*(.rodata.*)
}
.stack (NOLOAD) :
{
. += _stack_size;
_stack_top = .;
} >RAM
_sidata = LOADADDR(.data);
.data :
{
_sdata = .; /* used by startup code */
*(.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;