On Fri, Jan 30, 2026 at 10:55 PM Tom Rini <[email protected]> wrote:
>
> On Fri, Jan 30, 2026 at 11:12:17AM +0800, Brian Sune wrote:
>
> > The linker script u-boot-spl.lds now
> > is no longer aligned and -nodtb.bin ending shows
> > the zeros are not 8 byte aligned. This result in
> > the Makefile.xpl simply think the previous file
> > is aligned and do not zero pad. simply fix the
> > data align to 8 can ensure the -nodtb.bin is aligned,
> > hence, the formation of u-boot-spl.bin properly align.
> >
> > Signed-off-by: Brian Sune <[email protected]>
> > ---
> > arch/arm/cpu/u-boot-spl.lds | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> This fixes your problem in that it results in the device tree being
> aligned still, but doesn't solve the underlying problem of why there
Hi Tom,
Another follow up question here is even making the data node to
8 byte aligned will this create any harm or even fail case from first place?
As for testing on a real platform it makes no difference at all.
If "binman_sym_table" is empty then the previous node data is 8 byte aligned.
Where "__u_boot_list" is also gated by 8 byte end aligned unless it could be
empty while "binman_sym_table" does not.
Just wondering and not really too good at these linker scripts.
brian
> were 4 extra bytes. Can you please try:
>
> diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
> index c578c3ebf821..5f807323f856 100644
> --- a/arch/arm/cpu/u-boot-spl.lds
> +++ b/arch/arm/cpu/u-boot-spl.lds
> @@ -31,16 +31,16 @@ SECTIONS
> *(.data*)
> }
>
> - . = ALIGN(4);
> - __u_boot_list : {
> - KEEP(*(SORT(__u_boot_list*)));
> - }
> -
> . = ALIGN(4);
> .binman_sym_table : {
> __binman_sym_start = .;
> KEEP(*(SORT(.binman_sym*)));
> __binman_sym_end = .;
> + }
> +
> + . = ALIGN(4);
> + __u_boot_list : {
> + KEEP(*(SORT(__u_boot_list*)));
> . = ALIGN(8);
> }
>
> As the problem ends up being that when both of these are true:
> - .binman_sym_table is empty of actual .binman_sym* symbols
> - The inner '. = ALIGN(8);' increments the linker counter from the
> previous '. = ALIGN(4);' (in other words we were not already 8b
> aligned).
>
> The linker sets the type for this section to "NOBITS" which in turn
> means that when we later call objcopy to create u-boot-spl-nodtb.bin we
> get a mismatch between our expected size and actual size for creating
> the -pad.bin file.
>
> --
> Tom