From 8bb5a44b1854f865c612ed362776eb61c0d690f6 Mon Sep 17 00:00:00 2001 From: Peter Feerick <5500713+pfeerick@users.noreply.github.com> Date: Fri, 15 May 2026 10:46:20 +0000 Subject: [PATCH] fix(firmware): prevent LTO from eliminating the ISR vector table With LTO (-flto), the linker can discard the _isr_vector[] array because no C code references it directly (the hardware uses it via the VTOR register). KEEP() in the linker script prevents gc-sections from removing it, but LTO operates before that stage and can eliminate the symbol entirely, resulting in an empty .isr_vector section. Adding 'used' to ISR_VECTOR matches the same fix already applied to the BOOTSTRAP macro and init_hooks() in system_init.c. Co-Authored-By: Claude Sonnet 4.6 --- radio/src/targets/common/arm/stm32/cortex_m_isr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/common/arm/stm32/cortex_m_isr.h b/radio/src/targets/common/arm/stm32/cortex_m_isr.h index f329813dcf8..62d601f4a48 100644 --- a/radio/src/targets/common/arm/stm32/cortex_m_isr.h +++ b/radio/src/targets/common/arm/stm32/cortex_m_isr.h @@ -20,7 +20,7 @@ */ #define WEAK_DEFAULT __attribute__((weak,alias("Default_Handler"))) -#define ISR_VECTOR __attribute__((section(".isr_vector"))) +#define ISR_VECTOR __attribute__((section(".isr_vector"), used)) typedef void (*isr_t)(void); extern void* _estack;