Skip to content

Commit 6d896f0

Browse files
NU_PFM_M2351_NPSA: 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 50c3b10 commit 6d896f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/device/startup_M2351.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ WEAK_ALIAS_FUNC(TRNG_IRQHandler, Default_Handler) // 101:
192192

193193
/* Vector table */
194194
#if defined(__ARMCC_VERSION)
195-
__attribute__ ((section("RESET")))
195+
__attribute__ ((section("RESET"), used))
196196
const uint32_t __vector_handlers[] = {
197197
#elif defined(__ICCARM__)
198198
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) && (TFM_LVL > 0)

0 commit comments

Comments
 (0)