/* * Copyright (c) 2020-2022 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * * This file is derivative of ../armclang/mps2_an521_ns.sct */ /* Linker script to configure memory regions. */ /* This file will be run trough the pre-processor. */ #include "region_defs.h" define memory mem with size = 4G; define region NS_CODE_region = mem:[from NS_CODE_START size NS_CODE_SIZE]; define region NS_RAM_region = mem:[from NS_DATA_START size NS_DATA_SIZE]; define block CSTACK with alignment = 8, size = NS_STACK_SIZE { }; define block HEAP with alignment = 8, size = NS_HEAP_SIZE { }; define block ARM_LIB_HEAP with alignment = 8, size = NS_HEAP_SIZE { }; define overlay HEAP_OVL {block HEAP}; define overlay HEAP_OVL {block ARM_LIB_HEAP}; define block ER_CODE with fixed order, alignment = 8 { section .intvec, readonly}; define block ER_DATA with alignment = 8 {readwrite}; do not initialize { section .noinit }; initialize by copy { readwrite }; if (isdefinedsymbol(__USE_DLIB_PERTHREAD)) { // Required in a multi-threaded application initialize by copy with packing = none { section __DLIB_PERTHREAD }; } define block LR_CODE with fixed order {block ER_CODE}; define block DATA with fixed order {block ER_DATA, block CSTACK, overlay HEAP_OVL}; place in NS_CODE_region { block LR_CODE }; place in NS_RAM_region { block DATA };