]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
powerpc/mpc83xx: Move alignment padding into __u_boot_list section
authorJ. Neuschäfer <j.ne@posteo.net>
Sun, 29 Mar 2026 15:04:36 +0000 (17:04 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 2 Apr 2026 23:41:02 +0000 (17:41 -0600)
u-boot-dtb.bin is built by concatenating u-boot-nodtb.bin and u-boot.dtb.
u-boot-nodtb.bin, in turn, is generated by objcopy'ing the contents of
u-boot (U-Boot in ELF format) into a raw file.

In order to find the bundled FDT (u-boot.dtb), the code in lib/fdtdec.c
uses the _end symbol. Platform-specific linker scripts ensure that _end is
8-byte aligned, which is required by libfdt.

For the PowerPC MPC83xx platform, the ALIGN(8) directive was outside a
section, with the unfortunate effect that the potentially generated padding
bytes would not be copied by objcopy. This resulted in a discrepancy
between the _end symbol on the one hand, and the size of u-boot-nodtb.bin
and thus the starting location of the actual FDT on the other side. Under
these conditions, the FDT could not be found and boot would fail early.

This commit fixes it by moving the ALIGN(8) into the __u_boot_list section,
which is non-empty and thus copied into u-boot-nodtb.bin.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/powerpc/cpu/mpc83xx/u-boot.lds

index 5becc4d236ef4eae04be1b40943279b30b052d76..a765babee3f8f8a93fe8a53f3ec5a9e6f1cf8c05 100644 (file)
@@ -43,7 +43,8 @@ SECTIONS
 
   . = ALIGN(4);
   __u_boot_list : {
-       KEEP(*(SORT(__u_boot_list*)));
+    KEEP(*(SORT(__u_boot_list*)));
+    . = ALIGN(8);
   }
 
 
@@ -56,7 +57,6 @@ SECTIONS
    * _end - This is end of u-boot.bin image.
    * dtb will be appended here to make u-boot-dtb.bin
    */
-  . = ALIGN(8);
   _end = .;
 
   . = ALIGN(4096);