diff --git a/tools/cmake/infra/pc_bsa_image.ld.S b/tools/cmake/infra/acs_bm_image.ld.S similarity index 96% rename from tools/cmake/infra/pc_bsa_image.ld.S rename to tools/cmake/infra/acs_bm_image.ld.S index 754ae164..2b0b612c 100644 --- a/tools/cmake/infra/pc_bsa_image.ld.S +++ b/tools/cmake/infra/acs_bm_image.ld.S @@ -1,7 +1,7 @@ /** @file * Copyright (c) 2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 - + * * 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 @@ -17,6 +17,9 @@ #include "acs.h" +/* + * Shared bare-metal ACS image layout used by all firmware payloads. + */ IMAGE_BASE = PLATFORM_HOST_IMAGE_BASE; OUTPUT_FORMAT(elf64-littleaarch64) OUTPUT_ARCH(aarch64) diff --git a/tools/cmake/infra/bsa_image.ld.S b/tools/cmake/infra/bsa_image.ld.S deleted file mode 100644 index 47e94c5e..00000000 --- a/tools/cmake/infra/bsa_image.ld.S +++ /dev/null @@ -1,81 +0,0 @@ -/** @file - * Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved. - * SPDX-License-Identifier : Apache-2.0 - - * 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. -**/ - -#include "acs.h" - -IMAGE_BASE = PLATFORM_HOST_IMAGE_BASE; -OUTPUT_FORMAT(elf64-littleaarch64) -OUTPUT_ARCH(aarch64) -ENTRY(acs_entry) - -PHDRS -{ - readexec PT_LOAD FLAGS(5); /* R + X (Read + Execute) */ - readwrite PT_LOAD FLAGS(6); /* R + W (Read + Write) */ -} - -MEMORY { - RAM (rwx): ORIGIN = IMAGE_BASE, LENGTH = PLATFORM_HOST_IMAGE_SIZE -} - -SECTIONS -{ - . = IMAGE_BASE; - - ASSERT(. == ALIGN(PAGE_SIZE), - "TEXT_START address is not aligned to PAGE_SIZE.") - .text : { - __TEXT_START__ = .; - *BootEntry.S.o(.text*) - *(.text*) - . = NEXT(PAGE_SIZE); - __TEXT_END__ = .; - } :readexec - - .rodata : { - . = ALIGN(PAGE_SIZE); - __RODATA_START__ = .; - *(.rodata*) - - . = NEXT(PAGE_SIZE); - __RODATA_END__ = .; - - } :readexec - - .data : { - . = ALIGN(PAGE_SIZE); - __DATA_START__ = .; - *(.data*) - - . = ALIGN(8); - __GOT_START__ = .; - *(.got) - __GOT_END__ = .; - - . = NEXT(PAGE_SIZE); - __DATA_END__ = .; - } :readwrite - - .bss (NOLOAD) : { - . = ALIGN(PAGE_SIZE); - __BSS_START__ = .; - *(SORT_BY_ALIGNMENT(.bss*)) - *(COMMON) - . = NEXT(PAGE_SIZE); - __BSS_END__ = .; - } :readwrite -} diff --git a/tools/cmake/infra/sbsa_image.ld.S b/tools/cmake/infra/sbsa_image.ld.S deleted file mode 100644 index 47e94c5e..00000000 --- a/tools/cmake/infra/sbsa_image.ld.S +++ /dev/null @@ -1,81 +0,0 @@ -/** @file - * Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved. - * SPDX-License-Identifier : Apache-2.0 - - * 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. -**/ - -#include "acs.h" - -IMAGE_BASE = PLATFORM_HOST_IMAGE_BASE; -OUTPUT_FORMAT(elf64-littleaarch64) -OUTPUT_ARCH(aarch64) -ENTRY(acs_entry) - -PHDRS -{ - readexec PT_LOAD FLAGS(5); /* R + X (Read + Execute) */ - readwrite PT_LOAD FLAGS(6); /* R + W (Read + Write) */ -} - -MEMORY { - RAM (rwx): ORIGIN = IMAGE_BASE, LENGTH = PLATFORM_HOST_IMAGE_SIZE -} - -SECTIONS -{ - . = IMAGE_BASE; - - ASSERT(. == ALIGN(PAGE_SIZE), - "TEXT_START address is not aligned to PAGE_SIZE.") - .text : { - __TEXT_START__ = .; - *BootEntry.S.o(.text*) - *(.text*) - . = NEXT(PAGE_SIZE); - __TEXT_END__ = .; - } :readexec - - .rodata : { - . = ALIGN(PAGE_SIZE); - __RODATA_START__ = .; - *(.rodata*) - - . = NEXT(PAGE_SIZE); - __RODATA_END__ = .; - - } :readexec - - .data : { - . = ALIGN(PAGE_SIZE); - __DATA_START__ = .; - *(.data*) - - . = ALIGN(8); - __GOT_START__ = .; - *(.got) - __GOT_END__ = .; - - . = NEXT(PAGE_SIZE); - __DATA_END__ = .; - } :readwrite - - .bss (NOLOAD) : { - . = ALIGN(PAGE_SIZE); - __BSS_START__ = .; - *(SORT_BY_ALIGNMENT(.bss*)) - *(COMMON) - . = NEXT(PAGE_SIZE); - __BSS_END__ = .; - } :readwrite -} diff --git a/tools/cmake/toolchain/linker.cmake b/tools/cmake/toolchain/linker.cmake index 9ba3238b..40a2e086 100644 --- a/tools/cmake/toolchain/linker.cmake +++ b/tools/cmake/toolchain/linker.cmake @@ -36,7 +36,7 @@ set(GNUARM_OBJDUMP_FLAGS "-dSx") set(GNUARM_OBJCOPY_FLAGS "-Obinary") function (create_executable EXE_NAME OUTPUT_DIR TEST) - set(SCATTER_INPUT_FILE "${ROOT_DIR}/tools/cmake/infra/${EXE_NAME}_image.ld.S") + set(SCATTER_INPUT_FILE "${ROOT_DIR}/tools/cmake/infra/acs_bm_image.ld.S") set(SCATTER_OUTPUT_FILE "${OUTPUT_DIR}/${EXE_NAME}_image.ld") add_custom_command(OUTPUT CPP-LD--${EXE_NAME}${TEST}