[PATCH 2/5] arm64: initialize the frame pointer register

Casey Connolly casey.connolly at linaro.org
Thu Jul 3 13:22:48 CEST 2025



On 03/07/2025 07:19, Heinrich Schuchardt wrote:
> U-Boot may be compiled with frame pointers depending on defaults built into
> compilers are via explicitly passing -fno-omit-frame-pointer.
> 
> To stop walking frames it is necessary that the initial value of the frame
> pointer register is 0.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>

Reviewed-by: Casey Connolly <casey.connolly at linaro.org>> ---
>  arch/arm/lib/crt0_64.S | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
> index f3f279f2c39..3ff0577e9c8 100644
> --- a/arch/arm/lib/crt0_64.S
> +++ b/arch/arm/lib/crt0_64.S
> @@ -168,6 +168,7 @@ clear_loop:
>  	/* call board_init_r(gd_t *id, ulong dest_addr) */
>  	mov	x0, x18				/* gd_t */
>  	ldr	x1, [x18, #GD_RELOCADDR]	/* dest_addr */
> +	mov	x29, 0				/* frame pointer */
>  	b	board_init_r			/* PC relative jump */
>  
>  	/* NOTREACHED - board_init_r() does not return */

-- 
// Casey (she/her)



More information about the U-Boot mailing list