summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2025-08-25 23:18:13 +0200
committerDamien George <damien@micropython.org>2025-08-26 12:27:21 +1000
commit6c1d1f3ad4f5fb8139e9ba7517502bd441acd687 (patch)
tree127bce5f154d7533ea2434b5b547367ef286b40b
parent6650506e06787cb742d11aee3f07ffeb5bbe0e82 (diff)
qemu/mcu/arm/mps2.ld: Add .ARM.exidx section to the linkerscript.
This commit fixes a linking issue on certain Arm toolchains where library code is compiled with exception support. If a library with exception support is included in the MicroPython build, the linker had no place to put the stack unwinding tables necessary to perform exception handling at runtime. This change adds a new section to the linkerscript (and therefore the final ELF file) where that data can be placed into. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-rw-r--r--ports/qemu/mcu/arm/mps2.ld10
1 files changed, 9 insertions, 1 deletions
diff --git a/ports/qemu/mcu/arm/mps2.ld b/ports/qemu/mcu/arm/mps2.ld
index dffefa3b0..1597a7de3 100644
--- a/ports/qemu/mcu/arm/mps2.ld
+++ b/ports/qemu/mcu/arm/mps2.ld
@@ -19,7 +19,15 @@ SECTIONS
*(.rodata*)
. = ALIGN(4);
_etext = .;
- _sidata = _etext;
+ } > RAM
+
+ .ARM.exidx : AT ( _etext ) {
+ . = ALIGN(4);
+ __exidx_start = .;
+ *(.ARM.exidx*)
+ *(.gnu.linkonce.armexidx.*)
+ __exidx_end = .;
+ _sidata = __exidx_end;
} > RAM
.data : AT ( _sidata )