-
Notifications
You must be signed in to change notification settings - Fork 168
HardFaultTrampoline, relocation R_ARM_THM_JUMP11 out of range #572
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
Comments
What linker script are you using? In the one provided with cortex-m-rt, HardFaultTrampoline should always come immediately before HardFault for this specific reason, so I'm not sure what's going wrong here - maybe a different linker script or maybe some new bug in cortex-m-rt that's causing the functions to not go into the correct sections? cortex-m/cortex-m-rt/link.x.in Lines 102 to 105 in 9177271
|
I'm using https://github.com/oxidecomputer/hubris/blob/master/build/kernel-link.x It appears to do what is shown in your example
However, disabling link time optimizations does reproduce the issue 80% of the time, at least on my project. When I dump the symbols for a build with optimizations enabled, I notice that HardFaultTrampoline is placed after HardFault.
I wonder if it is possible that the certain linker expressions might be capturing either more or less than expected? I think the script is trying to place HardFaultTrampoline before HardFault, yet when I compile it gets placed after. Which makes it sensitive to size and vulnerable to failing when optimizations are disabled. edit: I fiddled with the linker script with no success, hard to debug "which lines are pulling in what" |
Which version of cortex-m-rt is this? With 0.7.5, there should not be a symbol called
I guess it may be 0.6.12, as that's the version referenced by https://github.com/oxidecomputer/hubris/blob/master/Cargo.toml? |
And then, which version of hybris are you using? It places the |
Closing because I just realized I am using an out of date version! I need to investigate this after I go through the process of getting the project up to date. |
On a Cortex-M0 running Hubris OS with link time optimizations temporarily disabled for debugging, I find linking often fails with the following:
I suppose this is why the Trampolines were made optional.
Is any guidance available for this issue. I believe there are two paths: either disabling the trampolines (I'm not sure what effect that has) or manually coaxing the linker into placing sections closer together?
looking at the source:
cortex-m/cortex-m-rt/macros/src/lib.rs
Line 387 in 9177271
I guess I could fork the library and maybe try to edit the assembly to work around the usage of the B instruction (BX would work better although it modifies the return address). Although that is a bit of a pain.
The text was updated successfully, but these errors were encountered: