]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ARM: Align image end to 8 bytes to fit DT alignment
authorMarek Vasut <marek.vasut@mailbox.org>
Sun, 18 May 2025 16:02:58 +0000 (18:02 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 2 Jun 2025 23:25:35 +0000 (17:25 -0600)
Align U-Boot image end to 8 bytes to make sure DT alignment requirement
is fulfilled. This fixes a possible failure in fdt_find_separate() in
case the U-Boot image is aligned to 4 Bytes and DT is appended at the
end at already 8 Byte aligned offset.

Link: https://source.denx.de/u-boot/u-boot/-/issues/30
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
arch/arm/cpu/u-boot-spl.lds
arch/arm/cpu/u-boot.lds

index eee463a1b1c6f8ace4808f74f709cfdc6a37674b..5aecb61ce902b8398525e21417df96a56d4d0746 100644 (file)
@@ -53,13 +53,14 @@ SECTIONS
                __rel_dyn_end = .;
        }
 
+       . = ALIGN(8);
        _image_binary_end = .;
        _end = .;
 
        .bss __rel_dyn_start (OVERLAY) : {
                __bss_start = .;
                *(.bss*)
-                . = ALIGN(4);
+                . = ALIGN(8);
                __bss_end = .;
        }
        __bss_size = __bss_end - __bss_start;
index 817e7a983ae624c4a0ec31daaea757d1351ad191..78aad093d3b207ebad65e4bca72d3f2eeb08bd84 100644 (file)
@@ -153,14 +153,14 @@ SECTIONS
                __efi_runtime_rel_stop = .;
        }
 
-       . = ALIGN(4);
+       . = ALIGN(8);
        __image_copy_end = .;
 
        /*
         * if CONFIG_USE_ARCH_MEMSET is not selected __bss_end - __bss_start
-        * needs to be a multiple of 4 and we overlay .bss with .rel.dyn
+        * needs to be a multiple of 8 and we overlay .bss with .rel.dyn
         */
-       .rel.dyn ALIGN(4) : {
+       .rel.dyn ALIGN(8) : {
                __rel_dyn_start = .;
                *(.rel*)
                __rel_dyn_end = .;