avr/atmega: Resolve memory corruption preventing boot

Resolve memory corruption issue where the memory values to be loaded
from flash to sram at boot contained incorrect values. Also added a
KEEP() guard around `.vectors` to prevent debug stripping from removing
them, as suggested by KR.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit is contained in:
Matteo Golin
2025-05-28 00:55:47 -04:00
committed by Alan C. Assis
parent b49b62a733
commit 557c83cea3

View File

@@ -112,7 +112,7 @@ SECTIONS
.text :
{
_stext = . ;
*(.vectors)
KEEP(*(.vectors))
*(.init)
*(.handlers)
*(.progmem .progmem.*)
@@ -122,8 +122,6 @@ SECTIONS
_etext = . ;
} > flash
_eronly = ABSOLUTE(.);
.data :
{
_sdata = ABSOLUTE(.);
@@ -134,6 +132,8 @@ SECTIONS
_edata = ABSOLUTE(.);
} > sram AT > flash
_eronly = LOADADDR(.data);
.bss :
{
_sbss = ABSOLUTE(.);