From 488f06b7e1b264779e6b76d29e39ca9c58bb967d Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Sat, 30 May 2020 22:07:26 +0100 Subject: [PATCH] NRF: Migrate ARM Compiler 5 feature re-locate zero initialized variables ARM Compiler 6 does not support placing a zero-initialized variable in a zero-initialized section with a given name. The migration path for this feature is what is as done in this commit. The name of the section is what comes after `.bss.` (`nvictable` in this case). Also simplify pre-processor directive to test for Arm compiler. --- .../TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.c index 23f87ea7ddd..5d07b60dc45 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.c @@ -47,8 +47,8 @@ #include "nrf_dfu_mbr.h" #endif -#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) - __attribute__ ((section(".bss.nvictable"),zero_init)) +#if defined(__ARMCC_VERSION) + __attribute__ ((section(".bss.nvictable"))) uint32_t nrf_dispatch_vector[NVIC_NUM_VECTORS]; #elif defined(__GNUC__) __attribute__ ((section(".nvictable")))