1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

atmega_common: add arch specific XFA ldscript to properly place .roxfa

This commit is contained in:
Joakim Nohlgård 2018-05-09 07:52:32 +02:00 committed by Kaspar Schleiser
parent 97e1be0830
commit 6adeec09e9
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,16 @@
SECTIONS
{
.data :
{
/* Special case for AVR (Harvard architecture) where .rodata is merged
* into .data by the toolchain default ldscripts. */
KEEP (*(SORT(.roxfa.*)))
KEEP (*(SORT(.xfa.*)))
}
__data_start = ADDR(.data);
__data_load_start = LOADADDR(.data);
__data_end = (__data_start + SIZEOF(.data));
__data_load_end = (__data_load_start + SIZEOF(.data));
}
INSERT AFTER .text;

View File

@ -9,8 +9,11 @@ CFLAGS_OPT ?= -Os
CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG)
# needed for xfa support. Order is important.
LINKFLAGS += -T$(RIOTCPU)/atmega_common/ldscripts/xfa.ld
LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -static -lgcc -e reset_handler -Wl,--gc-sections
OFLAGS += -j .text -j .data
# Use ROM_LEN and RAM_LEN during link
$(if $(ROM_LEN),,$(error ROM_LEN is not defined))