From 88bafcc09e921364d8062bf08359ffd8ba2ab007 Mon Sep 17 00:00:00 2001 From: Richard Campbell Date: Sun, 13 Nov 2022 10:53:59 -0800 Subject: [PATCH 1/2] Prevent LTO from omitting the ISR vector table --- cores/arduino/cortex_handlers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/arduino/cortex_handlers.c b/cores/arduino/cortex_handlers.c index 7ffd2107d..beb6776c6 100644 --- a/cores/arduino/cortex_handlers.c +++ b/cores/arduino/cortex_handlers.c @@ -196,6 +196,7 @@ extern uint32_t __bss_end__; extern uint32_t __StackTop; /* Exception Table */ +__attribute__ ((used)) __attribute__ ((section(".isr_vector"))) const DeviceVectors exception_table = { /* Configure Initial Stack Pointer, using linker-generated symbols */ From 7ca484ac85a260fc38d37e1bee4f4e7410c8a8df Mon Sep 17 00:00:00 2001 From: Richard Campbell Date: Sun, 13 Nov 2022 22:13:30 -0800 Subject: [PATCH 2/2] Prevent LTO from omitting the ISR vector table for SAMD21 too --- cores/arduino/cortex_handlers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/arduino/cortex_handlers.c b/cores/arduino/cortex_handlers.c index beb6776c6..953d1a6e1 100644 --- a/cores/arduino/cortex_handlers.c +++ b/cores/arduino/cortex_handlers.c @@ -408,6 +408,7 @@ extern uint32_t __bss_end__; extern uint32_t __StackTop; /* Exception Table */ +__attribute__ ((used)) __attribute__ ((section(".isr_vector"))) const DeviceVectors exception_table = { /* Configure Initial Stack Pointer, using linker-generated symbols */