From 65dabf8d1fc282cd2eac588b29af466ee652e6a3 Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Wed, 15 Apr 2026 19:01:38 +0200 Subject: [PATCH] qemu/mcu/arm/stm32.ld: Fix C++ linking. This commit expands the linkerscript for STM32-series boards to let C++ code link with the interpreter core. The linkerscript now contains all necessary sections for C++ code that uses exceptions to be part of a user module inside the MicroPython image. Signed-off-by: Alessandro Gatti --- ports/qemu/mcu/arm/stm32.ld | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/qemu/mcu/arm/stm32.ld b/ports/qemu/mcu/arm/stm32.ld index 835f9bbe97..b19edf7303 100644 --- a/ports/qemu/mcu/arm/stm32.ld +++ b/ports/qemu/mcu/arm/stm32.ld @@ -19,6 +19,13 @@ SECTIONS *(.text*) *(.rodata*) . = ALIGN(4); + *(.ARM.extab*) + *(.gnu.linkonce.armextab.*) + __exidx_start = .; + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + __exidx_end = .; + . = ALIGN(4); _etext = .; _sidata = _etext; } > ROM