From 2f01120d9368adc0baab794b8ef7a9e894ae1a7d Mon Sep 17 00:00:00 2001 From: deepikabhavnani Date: Tue, 26 Sep 2017 23:04:55 -0500 Subject: [PATCH] [M2351] Corrected preprocess define usage in toolchain specific linker files --- .../TARGET_M2351/device/TOOLCHAIN_ARM_STD/M2351.sct | 4 +++- .../TARGET_M2351/device/TOOLCHAIN_GCC_ARM/M2351.ld | 4 ++-- .../TARGET_M2351/device/TOOLCHAIN_IAR/M2351.icf | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_ARM_STD/M2351.sct b/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_ARM_STD/M2351.sct index 0f8587d3fc..b104b9c961 100644 --- a/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_ARM_STD/M2351.sct +++ b/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_ARM_STD/M2351.sct @@ -1,4 +1,6 @@ -#if (__DOMAIN_NS == 1U) +#! armcc -E + +#ifdef __DOMAIN_NS LR_IROM1 0x10040000 { ER_IROM1 0x10040000 { ; load address = execution address *(RESET, +First) diff --git a/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_GCC_ARM/M2351.ld b/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_GCC_ARM/M2351.ld index 6853a4c577..52d672af24 100644 --- a/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_GCC_ARM/M2351.ld +++ b/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_GCC_ARM/M2351.ld @@ -4,7 +4,7 @@ StackSize = 0x800; -#if (__DOMAIN_NS == 1U) +#ifdef __DOMAIN_NS MEMORY { @@ -125,7 +125,7 @@ SECTIONS KEEP(*(.eh_frame*)) } > FLASH -#if (__DOMAIN_NS != 1U) +#ifndef __DOMAIN_NS /* Veneer$$CMSE : */ .gnu.sgstubs : { diff --git a/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_IAR/M2351.icf b/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_IAR/M2351.icf index 953b1933ae..31f51d3f72 100644 --- a/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_IAR/M2351.icf +++ b/targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_IAR/M2351.icf @@ -2,7 +2,7 @@ /*-Editor annotation file-*/ /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ -#if (__DOMAIN_NS == 1U) +if (isdefinedsymbol(__DOMAIN_NS)) { /*-Specials-*/ define symbol __ICFEDIT_intvec_start__ = 0x10040000; /*-Memory Regions-*/ @@ -10,7 +10,7 @@ define symbol __ICFEDIT_region_ROM_start__ = 0x10040000; define symbol __ICFEDIT_region_ROM_end__ = 0x10080000 - 1; define symbol __ICFEDIT_region_IRAM_start__ = 0x30010000; define symbol __ICFEDIT_region_IRAM_end__ = 0x30020000 - 1; -#else +} else { /*-Specials-*/ define symbol __ICFEDIT_intvec_start__ = 0x00000000; /*-Memory Regions-*/ @@ -20,7 +20,7 @@ define symbol __ICFEDIT_region_NSCROM_start__ = 0x0003F000; define symbol __ICFEDIT_region_NSCROM_end__ = 0x00040000 - 1; define symbol __ICFEDIT_region_IRAM_start__ = 0x20000000; define symbol __ICFEDIT_region_IRAM_end__ = 0x20010000 - 1; -#endif +} /*-Sizes-*/ define symbol __ICFEDIT_size_cstack__ = 0x800; define symbol __ICFEDIT_size_heap__ = 0x4000; @@ -43,9 +43,9 @@ do not initialize { section .noinit }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; place in ROM_region { readonly }; -#if (__DOMAIN_NS != 1U) +if (!isdefinedsymbol(__DOMAIN_NS)) { place at address mem:__ICFEDIT_region_NSCROM_start__ { readonly section Veneer$$CMSE }; -#endif +} place at start of IRAM_region { block CSTACK }; place in IRAM_region { block IRAMVEC }; place in IRAM_region { readwrite };