diff options
| author | Mark Dykes <mark.dykes@arm.com> | 2026-01-08 15:53:14 +0000 |
|---|---|---|
| committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2026-01-08 15:53:14 +0000 |
| commit | c72e81c568c258f02f31fa7dc70cca566183b719 (patch) | |
| tree | 793739df80e8a468e11d35a704597be940a5023f | |
| parent | 02369bfe719bcc93373f6a752641d53da512abb2 (diff) | |
| parent | 56c4d2262f3c24ed23980309f6b6751460b5728a (diff) | |
| download | arm-trusted-firmware-c72e81c568c258f02f31fa7dc70cca566183b719.tar.gz arm-trusted-firmware-c72e81c568c258f02f31fa7dc70cca566183b719.zip | |
Merge changes from topic "st_clang_linker" into integration
* changes:
refactor(st): simplify rule to build .stm32 file
fix(st): use KEEP for .dtb_image and .bl2_image sections
| -rw-r--r-- | plat/st/common/common.mk | 7 | ||||
| -rw-r--r-- | plat/st/common/common_rules.mk | 8 | ||||
| -rw-r--r-- | plat/st/stm32mp1/stm32mp1.ld.S | 6 | ||||
| -rw-r--r-- | plat/st/stm32mp2/aarch64/stm32mp2.ld.S | 6 |
4 files changed, 13 insertions, 14 deletions
diff --git a/plat/st/common/common.mk b/plat/st/common/common.mk index 0bedb7224..0cb1feb27 100644 --- a/plat/st/common/common.mk +++ b/plat/st/common/common.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2023-2025, STMicroelectronics - All Rights Reserved +# Copyright (c) 2023-2026, STMicroelectronics - All Rights Reserved # Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause @@ -73,8 +73,11 @@ DTC_FLAGS += -Wno-interrupt_provider endif # Macros and rules to build TF binary -STM32_TF_ELF_LDFLAGS := --hash-style=gnu --as-needed STM32_TF_LINKERFILE := ${BUILD_PLAT}/${PLAT}.ld +STM32_TF_ELF_LDFLAGS := $(call ld_prefix,--hash-style=gnu) +STM32_TF_ELF_LDFLAGS += $(call ld_prefix,--as-needed) +STM32_TF_ELF_LDFLAGS += $(call ld_prefix,--script ${STM32_TF_LINKERFILE}) +STM32_TF_ELF_LDFLAGS += -static ASFLAGS += -DBL2_BIN_PATH=\"${BUILD_PLAT}/bl2.bin\" diff --git a/plat/st/common/common_rules.mk b/plat/st/common/common_rules.mk index acd0abd60..8557e0c6d 100644 --- a/plat/st/common/common_rules.mk +++ b/plat/st/common/common_rules.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2023-2025, STMicroelectronics - All Rights Reserved +# Copyright (c) 2023-2026, STMicroelectronics - All Rights Reserved # # SPDX-License-Identifier: BSD-3-Clause # @@ -56,11 +56,7 @@ $(eval $(call MAKE_LD,${STM32_TF_LINKERFILE},$(STM32_LD_FILE),bl2)) tf-a-%.elf: $(PLAT)-%.o ${STM32_TF_LINKERFILE} $(s)echo " LDS $<" -ifeq ($($(ARCH)-ld-id),gnu-gcc) - $(q)$($(ARCH)-ld) -o $@ $(subst --,-Wl$(comma)--,${STM32_TF_ELF_LDFLAGS}) -nostartfiles -static -Wl,--build-id=none -Wl,-Map=$(@:.elf=.map) -Wl,-dT ${STM32_TF_LINKERFILE} $< -else - $(q)$($(ARCH)-ld) -o $@ ${STM32_TF_ELF_LDFLAGS} -static --build-id=none -Map=$(@:.elf=.map) --script ${STM32_TF_LINKERFILE} $< -endif + $(q)$($(ARCH)-ld) -o $@ ${STM32_TF_ELF_LDFLAGS} $(TF_LDFLAGS) $(call ld_prefix,-Map=$(@:.elf=.map)) $< tf-a-%.bin: tf-a-%.elf $(q)$($(ARCH)-oc) -O binary $< $@ diff --git a/plat/st/stm32mp1/stm32mp1.ld.S b/plat/st/stm32mp1/stm32mp1.ld.S index c9d987361..4338afce0 100644 --- a/plat/st/stm32mp1/stm32mp1.ld.S +++ b/plat/st/stm32mp1/stm32mp1.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2025, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2026, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -45,7 +45,7 @@ SECTIONS */ . = ABSOLUTE( STM32MP_BL2_DTB_BASE ); __DTB_IMAGE_START__ = .; - *(.dtb_image*) + KEEP(*(.dtb_image*)) __DTB_IMAGE_END__ = .; /* @@ -59,7 +59,7 @@ SECTIONS . = ABSOLUTE( STM32MP_BL2_BASE ); #endif __BL2_IMAGE_START__ = .; - *(.bl2_image*) + KEEP(*(.bl2_image*)) __BL2_IMAGE_END__ = .; __DATA_END__ = .; diff --git a/plat/st/stm32mp2/aarch64/stm32mp2.ld.S b/plat/st/stm32mp2/aarch64/stm32mp2.ld.S index cf71f2736..ba03a726f 100644 --- a/plat/st/stm32mp2/aarch64/stm32mp2.ld.S +++ b/plat/st/stm32mp2/aarch64/stm32mp2.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2025, STMicroelectronics - All Rights Reserved + * Copyright (c) 2023-2026, STMicroelectronics - All Rights Reserved * * SPDX-License-Identifier: BSD-3-Clause */ @@ -45,7 +45,7 @@ SECTIONS */ . = ABSOLUTE( STM32MP_BL2_DTB_BASE ); __DTB_IMAGE_START__ = .; - *(.dtb_image*) + KEEP(*(.dtb_image*)) __DTB_IMAGE_END__ = .; /* @@ -59,7 +59,7 @@ SECTIONS . = ABSOLUTE( STM32MP_BL2_BASE ); #endif __BL2_IMAGE_START__ = .; - *(.bl2_image*) + KEEP(*(.bl2_image*)) __BL2_IMAGE_END__ = .; __DATA_END__ = .; |
