arm64: Add missing GD_FLG_SKIP_RELOC handling
Subsystems (2)
PATCH RESEND 1/1 arm64: Add missing GD_FLG_SKIP_RELOC handling
From: Marek Vasut <[email protected]>
In case U-Boot enters relocation with GD_FLG_SKIP_RELOC, skip the relocation. The code still has to set up new_gd pointer and new stack pointer.
Signed-off-by Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
--- arch/arm/lib/crt0_64.S | 4 ++++ lib/asm-offsets.c | 3 +++ 2 files changed, 7 insertions(+)
arch/arm/lib/crt0_64.S +4 -0
@@ -104,6 +104,10 @@ ENTRY(_main) bic sp, x0, #0xf /* 16-byte alignment for ABI compliance */ ldr x18, [x18, #GD_NEW_GD] /* x18 <- gd->new_gd */ + /* Skip relocation in case gd->gd_flags & GD_FLG_SKIP_RELOC */ + ldr x0, [x18, #GD_FLAGS] /* x0 <- gd->flags */ + tbnz x0, 11, relocation_return /* GD_FLG_SKIP_RELOC is bit 11 */ + adr lr, relocation_return #if CONFIG_POSITION_INDEPENDENT /* Add in link-vs-runtime offset */
lib/asm-offsets.c +3 -0
@@ -29,6 +29,9 @@ int main(void)DEFINE (GD_SIZE ,sizeof (struct global_data ));DEFINE (GD_BD , offsetof(struct global_data , bd)); + +DEFINE (GD_FLAGS , offsetof(struct global_data , flags)); +#if CONFIG_VAL (SYS_MALLOC_F_LEN )DEFINE (GD_MALLOC_BASE , offsetof(struct global_data , malloc_base));#endif
Signature · 1 line
2.33.0
Quoted 9 lines · On Sat, Nov 13, 2021 at 06:34:59PM +0100, [email protected] wrote:
From: Marek Vasut <[email protected]>
In case U-Boot enters relocation with
GD_FLG_SKIP_RELOC, skip the relocation. The code still has to set upnew_gdpointer and new stack pointer.Signed-off-by Marek Vasut <[email protected]>Cc Simon Glass <[email protected]>Cc Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom