1/* 2 * Copyright (c) 2026, Advanced Micro Devices, Inc. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 * Versal Gen 2 Platform Linker Script Template 7 * 8 * Built by plat/amd/common/custom_pkg.mk: 9 * - Each custom_pkg.ld.S is preprocessed separately with package-specific macros 10 * - This template preprocesses with #include of preprocessed scripts 11 * - Result is final plat.ld.S with TF-A core + custom package sections 12 */ 13 14#include <lib/xlat_tables/xlat_tables_defs.h> 15#include <platform_def.h> 16 17MEMORY { 18 BL31_OCRAM (rwx): ORIGIN = BL31_BASE, LENGTH = BL31_LIMIT - BL31_BASE 19} 20 21SECTIONS { 22 . = BL31_BASE; 23 ASSERT(. == ALIGN(PAGE_SIZE), "BL31_BASE not page-aligned") 24 25 /* TF-A Core Sections in BL31_OCRAM */ 26 .text . : { 27 __TEXT_START__ = . ; 28 *(.text*) *(.vectors) 29 . = ALIGN(PAGE_SIZE); 30 __TEXT_END__ = . ; 31 } >BL31_OCRAM AT >BL31_OCRAM 32 33 .rodata . : { 34 __RODATA_START__ = . ; 35 *(.rodata*) 36 . = ALIGN(PAGE_SIZE); 37 __RODATA_END__ = . ; 38 } >BL31_OCRAM AT >BL31_OCRAM 39 40 .data . : { 41 __DATA_START__ = . ; 42 *(.data*) 43 . = ALIGN(PAGE_SIZE); 44 __DATA_END__ = . ; 45 } >BL31_OCRAM AT >BL31_OCRAM 46 47 .bss . : { 48 __BSS_START__ = . ; 49 *(.bss*) 50 . = ALIGN(PAGE_SIZE); 51 __BSS_END__ = . ; 52 } >BL31_OCRAM AT >BL31_OCRAM 53 /* Custom Package Sections: appended inside SECTIONS */ 54#ifdef CUSTOM_PKG_LD_SCRIPTS_PP 55 #include CUSTOM_PKG_LD_SCRIPTS_PP 56#endif 57} 58