;/* ; * Copyright (c) 2022 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. ; * 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 CMSIS V5.00 gcc_arm.ld ; */ /* Linker script to configure memory regions. */ /* This file will be run trough the pre-processor. */ #include "region_defs.h" MEMORY { FLASH (rx) : ORIGIN = BL2_CODE_START, LENGTH = BL2_CODE_SIZE RAM (rwx) : ORIGIN = BL2_DATA_START, LENGTH = BL2_DATA_SIZE } __heap_size__ = BL2_HEAP_SIZE; __msp_stack_size__ = BL2_MSP_STACK_SIZE; /* Library configurations */ GROUP(libgcc.a libc.a libm.a libnosys.a) ENTRY(Reset_Handler) SECTIONS { .text : { KEEP(*(.vectors)) __Vectors_End = .; __Vectors_Size = __Vectors_End - __Vectors; __end__ = .; *(.text*) KEEP(*(.init)) KEEP(*(.fini)) /* .ctors */ *crtbegin.o(.ctors) *crtbegin?.o(.ctors) *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) *(SORT(.ctors.*)) *(.ctors) /* .dtors */ *crtbegin.o(.dtors) *crtbegin?.o(.dtors) *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) *(SORT(.dtors.*)) *(.dtors) *(.rodata*) KEEP(*(.eh_frame*)) } > FLASH .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > FLASH __exidx_start = .; .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } > FLASH __exidx_end = .; .copy.table : { . = ALIGN(4); __copy_table_start__ = .; #ifdef CODE_SHARING LONG (LOADADDR(.tfm_shared_symbols)) LONG (ADDR(.tfm_shared_symbols)) LONG (SIZEOF(.tfm_shared_symbols) / 4) #endif LONG (LOADADDR(.data)) LONG (ADDR(.data)) LONG (SIZEOF(.data) / 4) __copy_table_end__ = .; } > FLASH .zero.table : { . = ALIGN(4); __zero_table_start__ = .; LONG (ADDR(.bss)) LONG (SIZEOF(.bss) / 4) __zero_table_end__ = .; } > FLASH #ifdef CODE_SHARING /* The code sharing between bootloader and runtime firmware requires to * share the global variables. Section size must be equal with * SHARED_SYMBOL_AREA_SIZE defined in region_defs.h */ .tfm_shared_symbols : ALIGN(4) { *(.data.mbedtls_calloc_func) *(.data.mbedtls_free_func) *(.data.mbedtls_exit) *(.data.memset_func) . = ALIGN(SHARED_SYMBOL_AREA_SIZE); } > RAM AT > FLASH ASSERT(SHARED_SYMBOL_AREA_SIZE % 4 == 0, "SHARED_SYMBOL_AREA_SIZE must be divisible by 4") #endif .tfm_bl2_shared_data : ALIGN(32) { . += BOOT_TFM_SHARED_DATA_SIZE; } > RAM Image$$SHARED_DATA$$RW$$Base = ADDR(.tfm_bl2_shared_data); Image$$SHARED_DATA$$RW$$Limit = ADDR(.tfm_bl2_shared_data) + SIZEOF(.tfm_bl2_shared_data); .data : ALIGN(4) { *(vtable) *(.data*) . = ALIGN(4); /* preinit data */ PROVIDE_HIDDEN (__preinit_array_start = .); KEEP(*(.preinit_array)) PROVIDE_HIDDEN (__preinit_array_end = .); . = ALIGN(4); /* init data */ PROVIDE_HIDDEN (__init_array_start = .); KEEP(*(SORT(.init_array.*))) KEEP(*(.init_array)) PROVIDE_HIDDEN (__init_array_end = .); . = ALIGN(4); /* finit data */ PROVIDE_HIDDEN (__fini_array_start = .); KEEP(*(SORT(.fini_array.*))) KEEP(*(.fini_array)) PROVIDE_HIDDEN (__fini_array_end = .); KEEP(*(.jcr*)) . = ALIGN(4); } > RAM AT > FLASH Image$$ER_DATA$$Base = ADDR(.data); .bss : ALIGN(4) { . = ALIGN(4); __bss_start__ = .; *(.bss*) *(COMMON) . = ALIGN(4); __bss_end__ = .; } > RAM .msp_stack (NOLOAD) : ALIGN(32) { . += __msp_stack_size__; } > RAM Image$$ARM_LIB_STACK$$ZI$$Base = ADDR(.msp_stack); Image$$ARM_LIB_STACK$$ZI$$Limit = ADDR(.msp_stack) + SIZEOF(.msp_stack); .heap (NOLOAD): ALIGN(8) { . = ALIGN(8); __end__ = .; PROVIDE(end = .); __HeapBase = .; . += __heap_size__; __HeapLimit = .; __heap_limit = .; /* Add for _sbrk */ } > RAM Image$$ARM_LIB_HEAP$$ZI$$Limit = ADDR(.heap) + SIZEOF(.heap); PROVIDE(__stack = Image$$ARM_LIB_STACK$$ZI$$Limit); }