[PATCH] armv7: Add Position Independent Execution support

Tom Rini trini at konsulko.com
Mon Aug 2 23:30:45 CEST 2021


On Mon, Aug 02, 2021 at 06:44:57PM +0800, Chia-Wei Wang wrote:
> A U-Boot image could be loaded and executed at a different
> location than it was linked at.
> 
> For example, Aspeed takes a stable release version of U-Boot image
> as the golden one for recovery purposes. When the primary storage
> such as flash is corrupted, the golden image could be loaded to any
> SRAM/DRAM address on demands through ethernet/UART/etc.
> 
> To deal with this condition, the PIE is needed as there is only one
> signed, golden image, which could be however executed at different
> places.
> 
> This patch adds the PIE support for ARMv7 platform.
> 
> Signed-off-by: Chia-Wei Wang <chiawei_wang at aspeedtech.com>
> ---
>  arch/arm/Kconfig           |  4 +++-
>  arch/arm/cpu/armv7/start.S | 43 ++++++++++++++++++++++++++++++++++++++
>  arch/arm/lib/crt0.S        | 11 ++++++++++
>  arch/arm/lib/relocate.S    | 35 ++++++++++++++++++++++---------
>  4 files changed, 82 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 2b7b625705..45879c9f06 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -9,7 +9,7 @@ config ARM64
>  	select PHYS_64BIT
>  	select SYS_CACHE_SHIFT_6
>  
> -if ARM64
> +if ARM64 || CPU_V7A
>  config POSITION_INDEPENDENT
>  	bool "Generate position-independent pre-relocation code"
>  	help

Thanks for doing this.  I think we need to fix the depends on lines here
rather than hide with if ARM64 || CPU_V7A, and then fix anything else
that follows to also have the correct dependencies.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210802/48c105e3/attachment.sig>


More information about the U-Boot mailing list