[U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

Tom Rini trini at ti.com
Mon Aug 6 22:52:23 CEST 2012


On Mon, Aug 06, 2012 at 11:15:25PM +0400, Ilya Yanok wrote:
> Hi Tom,
> 
> On Mon, Aug 6, 2012 at 9:10 PM, Tom Rini <trini at ti.com> wrote:
> 
> >
> > OK, installed and it's still larger with this change than without and
> > it's not garbage collecting and dropping commands if I un-guard the
> > nandecc command for example.  Tested with omap3_beagle.
> >
> 
> Did some testing as well.
[snip]
> My interpretation: first two builds are equal, that's to be expected as in
> mainline U-Boot all command definitions are carefully guarded so remove
> undef patch has no effect at all. You said in your testing patched version
> produced bigger image... Probably you patched it by hand without commiting
> and got "-dirty" difference? (I did so initially ;) )

That would be it, yes :)

> Next, when we unguard the command we definitely get bigger image... But the
> code is not here:
> 
> $ arm-linux-gnueabi-nm ../out/undef+nandecc/spl/u-boot-spl |grep
> do_switch_ecc
> $
> 
> By comparing of two images I've found that the difference comes from
> ro-strings (two help strings in U_BOOT_CMD, string in printf, "sw" & "hw").
> It looks like the linker doesn't collect ro-strings referenced from
> collected functions... Probably that's a bug but I'm not sure...

Yes.  What I meant was that not all of the stuff that is guarded today
is garbage collected so the resulting image is larger than it must be.
And yes, this is a toolchain issue of sorts (not being aggressive enough
in collecting unreferenced data).

> 
> Regards, Ilya.

> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


-- 
Tom


More information about the U-Boot mailing list