From 03005fbe5006c4c79143fdddb453d3ec74e004f5 Mon Sep 17 00:00:00 2001 From: Yang Xiwen Date: Sat, 31 May 2025 21:10:02 +0800 Subject: [PATCH 1/2] arm: armv7: restore section to .text after saved_args when CONFIG_BLOBLIST is enabled, the section is switched to .data but is not switched back to .text. It makes all the code below placed in .data section, also breaks CONFIG_POSITION_INDEPENDENT. Fix it by adding `.section .text` to switch the section back to .text. Fixes: 5103e69344d6 ("arm: armv7: save boot arguments") Signed-off-by: Yang Xiwen --- arch/arm/cpu/armv7/start.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index 959251957de..833486817f8 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -182,6 +182,8 @@ saved_args: .word 0 .endr END(saved_args) + + .section .text #endif #ifdef CONFIG_ARMV7_LPAE From 0a7610c97ae6af8d2681e361eb24fce1cd63194d Mon Sep 17 00:00:00 2001 From: Yang Xiwen Date: Sat, 31 May 2025 21:10:03 +0800 Subject: [PATCH 2/2] arm: qemu: Add imply CONFIG_POSITION_INDEPENDENT Add 'imply CONFIG_POSITION_INDEPENTDENT' for QEMU arm arch. This allows qemu arm boards to load u-boot.bin at any address. It is skipped by default when u-boot is loaded by either --bios or --kernel. To load u-boot.bin at a different address, one can use u-boot chain-loading or qemu loader device[1]. [1] https://www.qemu.org/docs/master/system/generic-loader.html Signed-off-by: Yang Xiwen --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 79f60eb3f34..6ff3f2750ea 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1091,6 +1091,7 @@ config ARCH_QEMU imply USB_XHCI_PCI imply USB_KEYBOARD imply CMD_USB + imply POSITION_INDEPENDENT config ARCH_RENESAS bool "Renesas ARM SoCs"