Platform: Enable multiple data and bss section support

Enable the multiple data section copy and multiple bss
section clear on platform level. It always enabled in
case of secure firmware because there are data and bss
section per service.

In case of bootloader, the following platforms need this feature.

On Musca-B1 two section must be copied to SRAM by startup code:
- data section
- eFlash driver, it is executed from SRAM.

On Musca-A the entire bootloader copied and executed from SRAM
plus the data section also copied.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ibf91a656d5897b66bfbb57e6d6c61b08347b3a65
diff --git a/platform/ext/target/cypress/psoc64/CMakeLists.txt b/platform/ext/target/cypress/psoc64/CMakeLists.txt
index 46e11e2..682e7be 100644
--- a/platform/ext/target/cypress/psoc64/CMakeLists.txt
+++ b/platform/ext/target/cypress/psoc64/CMakeLists.txt
@@ -123,9 +123,6 @@
 )
 
 target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
     PRIVATE
         RTE_USART5
 )
diff --git a/platform/ext/target/cypress/psoc64/Device/Source/gcc/startup_psoc64_s.S b/platform/ext/target/cypress/psoc64/Device/Source/gcc/startup_psoc64_s.S
index 6d7eda2..3051f8a 100644
--- a/platform/ext/target/cypress/psoc64/Device/Source/gcc/startup_psoc64_s.S
+++ b/platform/ext/target/cypress/psoc64/Device/Source/gcc/startup_psoc64_s.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2020 ARM Limited. All rights reserved.
  * Copyright (c) 2019-2020, Cypress Semiconductor Corporation. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
@@ -21,6 +21,7 @@
    startup_psoc6_02_cm0plus.S*/
 
 #include "region_defs.h"
+#include "tfm_plat_config.h"
 
     /* Address of the NMI handler */
     #define CY_NMI_HANLDER_ADDR         0x0000000D
diff --git a/platform/ext/target/mps2/an519/CMakeLists.txt b/platform/ext/target/mps2/an519/CMakeLists.txt
index af6b650..f98e8f5 100644
--- a/platform/ext/target/mps2/an519/CMakeLists.txt
+++ b/platform/ext/target/mps2/an519/CMakeLists.txt
@@ -101,12 +101,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/mps2/an519/gcc/startup_cmsdk_mps2_an519_s.S b/platform/ext/target/mps2/an519/gcc/startup_cmsdk_mps2_an519_s.S
index e7302b1..aca6a49 100644
--- a/platform/ext/target/mps2/an519/gcc/startup_cmsdk_mps2_an519_s.S
+++ b/platform/ext/target/mps2/an519/gcc/startup_cmsdk_mps2_an519_s.S
@@ -1,5 +1,5 @@
 ;/*
-; * Copyright (c) 2009-2018 ARM Limited
+; * Copyright (c) 2009-2020 ARM Limited
 ; *
 ; * Licensed under the Apache License, Version 2.0 (the "License");
 ; * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.3.1 startup_ARMCM23.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.base
 
diff --git a/platform/ext/target/mps2/an521/CMakeLists.txt b/platform/ext/target/mps2/an521/CMakeLists.txt
index d827173..6851345 100644
--- a/platform/ext/target/mps2/an521/CMakeLists.txt
+++ b/platform/ext/target/mps2/an521/CMakeLists.txt
@@ -102,12 +102,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/mps2/an521/gcc/startup_cmsdk_mps2_an521_s.S b/platform/ext/target/mps2/an521/gcc/startup_cmsdk_mps2_an521_s.S
index ccac392..b206317 100644
--- a/platform/ext/target/mps2/an521/gcc/startup_cmsdk_mps2_an521_s.S
+++ b/platform/ext/target/mps2/an521/gcc/startup_cmsdk_mps2_an521_s.S
@@ -1,5 +1,5 @@
 ;/*
-; * Copyright (c) 2009-2018 ARM Limited
+; * Copyright (c) 2009-2020 ARM Limited
 ; *
 ; * Licensed under the Apache License, Version 2.0 (the "License");
 ; * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.00 startup_ARMCM33.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.main
 
diff --git a/platform/ext/target/mps2/an539/CMakeLists.txt b/platform/ext/target/mps2/an539/CMakeLists.txt
index dd7c2e6..e783586 100644
--- a/platform/ext/target/mps2/an539/CMakeLists.txt
+++ b/platform/ext/target/mps2/an539/CMakeLists.txt
@@ -111,12 +111,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/mps2/an539/device/source/gcc/startup_cmsdk_an539_mps2_s.S b/platform/ext/target/mps2/an539/device/source/gcc/startup_cmsdk_an539_mps2_s.S
index 3ef49f5..157891e 100644
--- a/platform/ext/target/mps2/an539/device/source/gcc/startup_cmsdk_an539_mps2_s.S
+++ b/platform/ext/target/mps2/an539/device/source/gcc/startup_cmsdk_an539_mps2_s.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 Arm Limited
+ * Copyright (c) 2009-2020 Arm Limited
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,8 @@
  * Git SHA: cb3fb9a70f3de3670bf5523a588c7f63cec48ff6
  */
 
+#include "tfm_plat_config.h"
+
     .syntax   unified
     .arch     armv8-m.base
 
diff --git a/platform/ext/target/mps2/fvp_sse300/CMakeLists.txt b/platform/ext/target/mps2/fvp_sse300/CMakeLists.txt
index 9b07340..2593e20 100644
--- a/platform/ext/target/mps2/fvp_sse300/CMakeLists.txt
+++ b/platform/ext/target/mps2/fvp_sse300/CMakeLists.txt
@@ -114,12 +114,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/mps2/sse-200_aws/CMakeLists.txt b/platform/ext/target/mps2/sse-200_aws/CMakeLists.txt
index b77193c..0d11c14 100644
--- a/platform/ext/target/mps2/sse-200_aws/CMakeLists.txt
+++ b/platform/ext/target/mps2/sse-200_aws/CMakeLists.txt
@@ -102,11 +102,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s PUBLIC
-    __STARTUP_CLEAR_BSS_MULTIPLE
-    __STARTUP_COPY_MULTIPLE
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/mps2/sse-200_aws/gcc/startup_cmsdk_sse-200_aws_s.S b/platform/ext/target/mps2/sse-200_aws/gcc/startup_cmsdk_sse-200_aws_s.S
index 35215af..2584242 100644
--- a/platform/ext/target/mps2/sse-200_aws/gcc/startup_cmsdk_sse-200_aws_s.S
+++ b/platform/ext/target/mps2/sse-200_aws/gcc/startup_cmsdk_sse-200_aws_s.S
@@ -1,5 +1,5 @@
 ;/*
-; * Copyright (c) 2009-2019 Arm Limited
+; * Copyright (c) 2009-2020 Arm Limited
 ; *
 ; * Licensed under the Apache License, Version 2.0 (the "License");
 ; * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.00 startup_ARMCM33.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.main
 
diff --git a/platform/ext/target/mps3/an524/CMakeLists.txt b/platform/ext/target/mps3/an524/CMakeLists.txt
index f56b0ed..1256763 100644
--- a/platform/ext/target/mps3/an524/CMakeLists.txt
+++ b/platform/ext/target/mps3/an524/CMakeLists.txt
@@ -102,12 +102,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/mps3/an524/device/source/gcc/startup_cmsdk_mps3_an524_s.S b/platform/ext/target/mps3/an524/device/source/gcc/startup_cmsdk_mps3_an524_s.S
index 6e6c976..b8fb930 100644
--- a/platform/ext/target/mps3/an524/device/source/gcc/startup_cmsdk_mps3_an524_s.S
+++ b/platform/ext/target/mps3/an524/device/source/gcc/startup_cmsdk_mps3_an524_s.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2019 Arm Limited. All rights reserved.
+ * Copyright (c) 2009-2020 Arm Limited. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@
  * Git SHA: 8a1d9d6ee18b143ae5befefa14d89fb5b3f99c75
  */
 
+#include "tfm_plat_config.h"
+
     .syntax   unified
     .arch     armv8-m.main
 
diff --git a/platform/ext/target/musca_a/CMakeLists.txt b/platform/ext/target/musca_a/CMakeLists.txt
index 3464f15..e2814a4 100644
--- a/platform/ext/target/musca_a/CMakeLists.txt
+++ b/platform/ext/target/musca_a/CMakeLists.txt
@@ -61,11 +61,6 @@
             $<$<C_COMPILER_ID:GNU>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/gcc/musca_bl2.ld>
             $<$<C_COMPILER_ID:IAR>:${CMAKE_CURRENT_SOURCE_DIR}/Device/Source/iar/musca_bl2.icf>
     )
-    target_compile_definitions(bl2
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-    )
 endif()
 
 #========================= Platform Secure ====================================#
@@ -112,12 +107,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_bl2.S b/platform/ext/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_bl2.S
index 7c1e449..82a57b2 100644
--- a/platform/ext/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_bl2.S
+++ b/platform/ext/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_bl2.S
@@ -1,5 +1,5 @@
 ;/*
-; * Copyright (c) 2009-2018 ARM Limited
+; * Copyright (c) 2009-2020 ARM Limited
 ; *
 ; * Licensed under the Apache License, Version 2.0 (the "License");
 ; * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.00 startup_ARMCM33.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.main
 
diff --git a/platform/ext/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_s.S b/platform/ext/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_s.S
index f3b5d91..639ce0b 100644
--- a/platform/ext/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_s.S
+++ b/platform/ext/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_s.S
@@ -1,5 +1,5 @@
 ;/*
-; * Copyright (c) 2009-2019 Arm Limited
+; * Copyright (c) 2009-2020 Arm Limited
 ; *
 ; * Licensed under the Apache License, Version 2.0 (the "License");
 ; * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.00 startup_ARMCM33.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.main
 
diff --git a/platform/ext/target/musca_b1/CMakeLists.txt b/platform/ext/target/musca_b1/CMakeLists.txt
index c71d50b..cef50a4 100644
--- a/platform/ext/target/musca_b1/CMakeLists.txt
+++ b/platform/ext/target/musca_b1/CMakeLists.txt
@@ -101,12 +101,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/musca_b1/Device/Source/gcc/startup_cmsdk_musca_bl2.S b/platform/ext/target/musca_b1/Device/Source/gcc/startup_cmsdk_musca_bl2.S
index 7c1e449..82a57b2 100644
--- a/platform/ext/target/musca_b1/Device/Source/gcc/startup_cmsdk_musca_bl2.S
+++ b/platform/ext/target/musca_b1/Device/Source/gcc/startup_cmsdk_musca_bl2.S
@@ -1,5 +1,5 @@
 ;/*
-; * Copyright (c) 2009-2018 ARM Limited
+; * Copyright (c) 2009-2020 ARM Limited
 ; *
 ; * Licensed under the Apache License, Version 2.0 (the "License");
 ; * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.00 startup_ARMCM33.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.main
 
diff --git a/platform/ext/target/musca_b1/Device/Source/gcc/startup_cmsdk_musca_s.S b/platform/ext/target/musca_b1/Device/Source/gcc/startup_cmsdk_musca_s.S
index f3b5d91..639ce0b 100644
--- a/platform/ext/target/musca_b1/Device/Source/gcc/startup_cmsdk_musca_s.S
+++ b/platform/ext/target/musca_b1/Device/Source/gcc/startup_cmsdk_musca_s.S
@@ -1,5 +1,5 @@
 ;/*
-; * Copyright (c) 2009-2019 Arm Limited
+; * Copyright (c) 2009-2020 Arm Limited
 ; *
 ; * Licensed under the Apache License, Version 2.0 (the "License");
 ; * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.00 startup_ARMCM33.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.main
 
diff --git a/platform/ext/target/musca_s1/CMakeLists.txt b/platform/ext/target/musca_s1/CMakeLists.txt
index 18ddc7e..cf159ee 100644
--- a/platform/ext/target/musca_s1/CMakeLists.txt
+++ b/platform/ext/target/musca_s1/CMakeLists.txt
@@ -97,12 +97,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/musca_s1/Device/Source/gcc/startup_cmsdk_musca_s.S b/platform/ext/target/musca_s1/Device/Source/gcc/startup_cmsdk_musca_s.S
index 46d384b..bd4922d 100644
--- a/platform/ext/target/musca_s1/Device/Source/gcc/startup_cmsdk_musca_s.S
+++ b/platform/ext/target/musca_s1/Device/Source/gcc/startup_cmsdk_musca_s.S
@@ -1,5 +1,5 @@
 ;/*
-; * Copyright (c) 2009-2019 Arm Limited. All rights reserved.
+; * Copyright (c) 2009-2020 Arm Limited. All rights reserved.
 ; *
 ; * Licensed under the Apache License, Version 2.0 (the "License");
 ; * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.00 startup_ARMCM33.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.main
 
diff --git a/platform/ext/target/nordic_nrf/common/core/CMakeLists.txt b/platform/ext/target/nordic_nrf/common/core/CMakeLists.txt
index 43c425e..36abb79 100644
--- a/platform/ext/target/nordic_nrf/common/core/CMakeLists.txt
+++ b/platform/ext/target/nordic_nrf/common/core/CMakeLists.txt
@@ -73,12 +73,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/nordic_nrf/common/nrf5340/gcc/startup_nrf5340_s.S b/platform/ext/target/nordic_nrf/common/nrf5340/gcc/startup_nrf5340_s.S
index 4816b2c..346699c 100644
--- a/platform/ext/target/nordic_nrf/common/nrf5340/gcc/startup_nrf5340_s.S
+++ b/platform/ext/target/nordic_nrf/common/nrf5340/gcc/startup_nrf5340_s.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2020 ARM Limited. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -21,6 +21,8 @@
  * Git SHA: 8a1d9d6ee18b143ae5befefa14d89fb5b3f99c75
  */
 
+#include "tfm_plat_config.h"
+
     .syntax unified
     .arch   armv8-m.main
 
diff --git a/platform/ext/target/nordic_nrf/common/nrf9160/gcc/startup_nrf9160_s.S b/platform/ext/target/nordic_nrf/common/nrf9160/gcc/startup_nrf9160_s.S
index df80b1c..00a597c 100644
--- a/platform/ext/target/nordic_nrf/common/nrf9160/gcc/startup_nrf9160_s.S
+++ b/platform/ext/target/nordic_nrf/common/nrf9160/gcc/startup_nrf9160_s.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
+ * Copyright (c) 2009-2020 ARM Limited. All rights reserved.
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -21,6 +21,8 @@
  * Git SHA: 8a1d9d6ee18b143ae5befefa14d89fb5b3f99c75
  */
 
+#include "tfm_plat_config.h"
+
     .syntax unified
     .arch   armv8-m.main
 
diff --git a/platform/ext/target/nuvoton/m2351/CMakeLists.txt b/platform/ext/target/nuvoton/m2351/CMakeLists.txt
index 3ee1d6e..5a28f6b 100644
--- a/platform/ext/target/nuvoton/m2351/CMakeLists.txt
+++ b/platform/ext/target/nuvoton/m2351/CMakeLists.txt
@@ -115,12 +115,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_sources(platform_ns
diff --git a/platform/ext/target/nuvoton/m2351/device/source/gcc/startup_cmsdk_m2351_s.S b/platform/ext/target/nuvoton/m2351/device/source/gcc/startup_cmsdk_m2351_s.S
index 68c80e0..58f29dd 100644
--- a/platform/ext/target/nuvoton/m2351/device/source/gcc/startup_cmsdk_m2351_s.S
+++ b/platform/ext/target/nuvoton/m2351/device/source/gcc/startup_cmsdk_m2351_s.S
@@ -18,6 +18,8 @@
 ; * This file is derivative of CMSIS V5.3.1 startup_ARMCM23.S
 ; */
 
+#include "tfm_plat_config.h"
+
     .syntax    unified
     .arch    armv8-m.base
 
diff --git a/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt b/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt
index 97cfd9c..fb5c7c1 100644
--- a/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt
+++ b/platform/ext/target/nxp/lpcxpresso55s69/CMakeLists.txt
@@ -121,12 +121,6 @@
         ${COMPILER_CMSE_FLAG}
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 # GNU ld has some strange behaviour to do with weak functions, and does not deal
 # well with strong functions in static libraries overriding weak functions in
 # object files. For this reason, the file hardware_init is linked directly to
diff --git a/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/armgcc/startup_LPC55S69_cm33_core0_s.S b/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/armgcc/startup_LPC55S69_cm33_core0_s.S
index 6681c99..8a03925 100755
--- a/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/armgcc/startup_LPC55S69_cm33_core0_s.S
+++ b/platform/ext/target/nxp/lpcxpresso55s69/Device/Source/armgcc/startup_LPC55S69_cm33_core0_s.S
@@ -1,5 +1,5 @@
 ;/*

-; * Copyright (c) 2009-2018 ARM Limited

+; * Copyright (c) 2009-2020 ARM Limited

 ; *

 ; * Licensed under the Apache License, Version 2.0 (the "License");

 ; * you may not use this file except in compliance with the License.

@@ -17,6 +17,8 @@
 ; * This file is derivative of CMSIS V5.00 startup_ARMCM33.S

 ; */

 

+#include "tfm_plat_config.h"

+

     .syntax    unified

     .arch    armv8-m.main

 

diff --git a/platform/ext/target/stm/common/stm32l5xx/CMakeLists.txt b/platform/ext/target/stm/common/stm32l5xx/CMakeLists.txt
index 01da0a8..d893f39 100644
--- a/platform/ext/target/stm/common/stm32l5xx/CMakeLists.txt
+++ b/platform/ext/target/stm/common/stm32l5xx/CMakeLists.txt
@@ -99,12 +99,6 @@
         ${CMAKE_CURRENT_SOURCE_DIR}/Native_Driver/tick.c
 )
 
-target_compile_definitions(platform_s
-    PUBLIC
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_CLEAR_BSS_MULTIPLE>
-        $<$<C_COMPILER_ID:GNU>:__STARTUP_COPY_MULTIPLE>
-)
-
 #========================= Platform Non-Secure ================================#
 
 target_include_directories(platform_ns
diff --git a/platform/include/tfm_plat_config.h b/platform/include/tfm_plat_config.h
new file mode 100644
index 0000000..448964d
--- /dev/null
+++ b/platform/include/tfm_plat_config.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2020, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+#ifndef __TFM_PLAT_CONFIG_H__
+#define __TFM_PLAT_CONFIG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Enable the multiple data section copy and bss section clear feature
+ * in GNUARM low level start-up.
+ */
+#define __STARTUP_COPY_MULTIPLE
+#define __STARTUP_CLEAR_BSS_MULTIPLE
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TFM_PLAT_CONFIG_H__ */
\ No newline at end of file