Skip to content

Commit f0dc4ab

Browse files
NUMAKER_M252KG: 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 9aade4a commit f0dc4ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_NUVOTON/TARGET_M251/device/startup_M251.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ WEAK_ALIAS_FUNC(OPA_IRQHandler, Default_Handler) // 62: OPA Interrupt
155155

156156
/* Vector table */
157157
#if defined(__ARMCC_VERSION)
158-
__attribute__ ((section("RESET")))
158+
__attribute__ ((section("RESET"), used))
159159
const uint32_t __vector_handlers[] = {
160160
#elif defined(__ICCARM__)
161161
extern uint32_t CSTACK$$Limit;

0 commit comments

Comments
 (0)