Skip to content

Commit 50c3b10

Browse files
NUMAKER_PFM_NUC472: keep __vector_handlers symbol in LTO builds
Add a "used" attribute to __vector_handlers to fix ARMC6 build with the "-flto" flag. (Error: L6236E: No section matches selector - no section to be FIRST/LAST.) This attribute, attached to a function/variable, means that code must be emitted for the function even if it appears that the function is not referenced.
1 parent ad7f27b commit 50c3b10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_NUVOTON/TARGET_NUC472/device/startup_NUC472_442.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ WEAK_ALIAS_FUNC(CRC_IRQHandler, Default_Handler) // 141: CRC
232232

233233
/* Vector table */
234234
#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
235-
__attribute__ ((section("RESET")))
235+
__attribute__ ((section("RESET"), used))
236236
const uint32_t __vector_handlers[] = {
237237
#elif defined(__ICCARM__)
238238
extern uint32_t CSTACK$$Limit;

0 commit comments

Comments
 (0)