/* * 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" do not initialize { section .noinit }; initialize by copy { readwrite }; define block ER_CODE with fixed order, alignment = 8 { section .intvec, readonly }; define block LR_CODE with fixed order, maximum size = BL2_CODE_SIZE {block ER_CODE}; place at address BL2_CODE_START {block LR_CODE}; define block TFM_SHARED_DATA with alignment = 32, size = BOOT_TFM_SHARED_DATA_SIZE { }; define block ER_DATA with alignment = 32 {readwrite}; define block ARM_LIB_STACK with alignment = 32, size = BL2_MSP_STACK_SIZE { }; define block HEAP with alignment = 8, size = BL2_HEAP_SIZE { }; define block ARM_LIB_HEAP with alignment = 8, size = BL2_HEAP_SIZE { }; define overlay HEAP_OVL {block HEAP}; define overlay HEAP_OVL {block ARM_LIB_HEAP}; keep {block TFM_SHARED_DATA, block ER_DATA, block ARM_LIB_STACK, block HEAP, block ARM_LIB_HEAP}; 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 = BL2_DATA_SIZE { block TFM_SHARED_DATA, block ER_DATA, block ARM_LIB_STACK, overlay HEAP_OVL }; place at address BOOT_TFM_SHARED_DATA_BASE {block DATA};