-
Notifications
You must be signed in to change notification settings - Fork 177
Closed
Description
On a Cortex-M0 running Hubris OS with link time optimizations temporarily disabled for debugging, I find linking often fails with the following:
= note: rust-lld: error: /target/thumbv6m-none-eabi/release/deps/libcortex_m_rt-30b54eec0d9b4b99.rlib(cortex-m-rt.o):(function HardFaultTrampoline: .HardFaultTrampoline+0xc): relocation R_ARM_THM_JUMP11 out of range: -5547 is not in [-2048, 2047]; references 'HardFault'
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
| .section .HardFaultTrampoline, \"ax\" |
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.
Metadata
Metadata
Assignees
Labels
No labels