/* * Copyright (c) 2022 Arm Limited * Copyright (c) 2021 IAR Systems AB * * 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. * */ /* Linker script to configure memory regions. */ /* This file will be run trough the pre-processor. */ #include "region_defs.h" define block ER_CODE with fixed order, alignment = 8 { section .intvec, readonly}; define block LR_CODE with fixed order {block ER_CODE}; place at address NS_CODE_START {block LR_CODE}; define block ER_DATA with alignment = 8 {readwrite}; define block CSTACK with alignment = 32, 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}; keep {block CSTACK, block HEAP, block ARM_LIB_HEAP}; 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 DATA with fixed order, maximum size = NS_DATA_SIZE { block ER_DATA, block CSTACK, overlay HEAP_OVL }; place at address NS_DATA_START {block DATA};