Merge tag 'v2022.01-rc3' into next
[platform/kernel/u-boot.git] / arch / arm / lib / crt0_64.S
index 611affb..84c04bd 100644 (file)
@@ -108,6 +108,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 */