-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: introduce crossfile arrays (xfa), refactored #9105
Conversation
@gebart would you mind rebasing? The diff is quite large as is. |
Will do soon ish, when I am back at the computer |
@kaspar030 Feel free to rebase and force push to my branch if you like |
I tried a static test: diff --git a/tests/xfa/Makefile b/tests/xfa/Makefile
index abe5a68..d5b1763 100644
--- a/tests/xfa/Makefile
+++ b/tests/xfa/Makefile
@@ -3,3 +3,11 @@ APPLICATION = xfa
include ../Makefile.tests_common
include $(RIOTBASE)/Makefile.include
+
+all: static-test
+static-test: $(ELFFILE)
+ $(eval xfastart := $(shell $(PREFIX)readelf --symbols $< |\
+ grep ' xfatest_const$$' | awk '{printf "0x%s", $$2}'))
+ $(eval xfaend := $(shell $(PREFIX)readelf --symbols $< |\
+ grep ' xfatest_const_end$$' | awk '{printf "0x%s", $$2}'))
+ bash -c "[[ $(xfastart) < $(xfaend) ]]" Only tested that I get an error when changing the sign, not really tested on a non implemented board. |
When commenting |
For mips_pic32 it's the I copied xfa.ld to diff --git a/cpu/mips_pic32_common/Makefile.include b/cpu/mips_pic32_common/Makefile.include
index e0582db..648adce 100644
--- a/cpu/mips_pic32_common/Makefile.include
+++ b/cpu/mips_pic32_common/Makefile.include
@@ -2,6 +2,8 @@ include $(RIOTCPU)/mips32r2_common/Makefile.include
export INCLUDES += -I$(RIOTCPU)/mips_pic32_common/include
+LINKFLAGS += -L$(RIOTCPU)/mips_pic32_common/ldscripts
+
USEMODULE += mips_pic32_common
USEMODULE += mips_pic32_common_periph
diff --git a/cpu/mips_pic32_common/ldscripts/xfa.ld b/cpu/mips_pic32_common/ldscripts/xfa.ld
index 34b7d76..9816bc2 100644
--- a/cpu/mips_pic32_common/ldscripts/xfa.ld
+++ b/cpu/mips_pic32_common/ldscripts/xfa.ld
@@ -10,7 +10,7 @@ SECTIONS
__data_load_end = (__data_load_start + SIZEOF(.data));
}
-INSERT AFTER .text;
+INSERT AFTER .init;
SECTIONS
{ |
For msp430 based boards using
I disabled it with:
With the |
I successfully run the xfa test with I could re-run all the automated tests these ones when it works again. |
Hmm, in fact, the real problem is that |
@cladmi could you test on those boards with only the cortexm_common ldscript refactoring applied? |
Bisecting tells me it is the first bad commit:
|
We need to examine the linker map for that build (hello-world.map) |
Updated:
|
The PIC32 ldscripts are messy and difficult to work with... Trying to find a solution for now |
I found a solution to get what I believe is a correct memory map for PIC32 XFA. I don't have any hardware to test on though. Could someone run unittests/tests-core or tests/xfa on a pic32-clicker or pic32-wifire please? |
I will now be able to do on |
For
There is currently no
|
It was missing the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
XFA support was merged in #15002, closing. |
Contribution description
A rebase of #7523. The alternate approach used here is to avoid introducing platform specific ldscripts and instead use the same approach as was used for the native platform in #7523. The only exception here is the AVR arch which needs a specific version of the patch ldscript to ensure that the xfa sections are placed where the code can use them. The AVR is a Harvard architecture which means that we can't simply place data in the code memory segment without adding extra code for accessing it.
TODO: Static check of linking xfa sections as suggested in #7523 (comment)
Issues/PRs references
rebase/refresh of #7523
based on #9104 #9089