From 6d896f032f65b856da0ad581cf9974eaece0a892 Mon Sep 17 00:00:00 2001 From: Maciej Bocianski Date: Wed, 4 Dec 2019 10:19:23 +0100 Subject: [PATCH] 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. --- targets/TARGET_NUVOTON/TARGET_M2351/device/startup_M2351.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M2351/device/startup_M2351.c b/targets/TARGET_NUVOTON/TARGET_M2351/device/startup_M2351.c index 5045697770..fdac4da8d2 100644 --- a/targets/TARGET_NUVOTON/TARGET_M2351/device/startup_M2351.c +++ b/targets/TARGET_NUVOTON/TARGET_M2351/device/startup_M2351.c @@ -192,7 +192,7 @@ WEAK_ALIAS_FUNC(TRNG_IRQHandler, Default_Handler) // 101: /* Vector table */ #if defined(__ARMCC_VERSION) -__attribute__ ((section("RESET"))) +__attribute__ ((section("RESET"), used)) const uint32_t __vector_handlers[] = { #elif defined(__ICCARM__) #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) && (TFM_LVL > 0)