diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index 9c08c7d8b9..fa5e2ad186 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -59,6 +59,9 @@ else LINKFLAGS += -ldl endif +# XFA (cross file array) support +LINKFLAGS += -T$(RIOTBASE)/cpu/native/ldscripts/xfa.ld + # clean up unused functions CFLAGS += -ffunction-sections -fdata-sections ifeq ($(OS),Darwin) diff --git a/cpu/native/ldscripts/xfa.ld b/cpu/native/ldscripts/xfa.ld new file mode 100644 index 0000000000..d2b7d1d6dc --- /dev/null +++ b/cpu/native/ldscripts/xfa.ld @@ -0,0 +1,19 @@ +SECTIONS +{ + .data : + { + KEEP (*(SORT(.xfa.*))) + } +} + +INSERT AFTER .text; + +SECTIONS +{ + .rodata : + { + KEEP (*(SORT(.roxfa.*))) + } +} + +INSERT AFTER .text;