From ee9d6c879aad97e85c19e5fcf29068bf141375cf Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 3 Nov 2020 11:46:48 +0100 Subject: [PATCH] cpu/native: add XFA support --- boards/native/Makefile.include | 3 +++ cpu/native/ldscripts/xfa.ld | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 cpu/native/ldscripts/xfa.ld 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;