[U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined
Ilya Yanok
ilya.yanok at cogentembedded.com
Mon Aug 6 21:15:25 CEST 2012
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.
master branch, omap3_beagle config. Trying clean master, master + remove
undef patch, master + remove undef patch + un-guard nandecc & master +
un-guard nandecc.
Here is my results:
$ ls -l ../out/master/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44692 Aug 6 21:57 ../out/master/spl/u-boot-spl.bin
$ ls -l ../out/undef/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44692 Aug 6 21:52 ../out/undef/spl/u-boot-spl.bin
$ ls -l ../out/undef+nandecc/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44844 Aug 6 21:53
../out/undef+nandecc/spl/u-boot-spl.bin
(and master + un-guard ecc actually failed to build with:
$ ./MAKEALL omap3_beagle
Configuring for omap3_beagle board...
make[1]: *** [/work/u-boot/spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl.bin] Error 2
text data bss dec hex filename
326458 8460 266904 601822 92ede ./u-boot
arch/arm/cpu/armv7/omap3/libomap3.o: In function `do_switch_ecc':
/work/u-boot/arch/arm/cpu/armv7/omap3/board.c:312: undefined reference to
`omap_nand_switch_ecc'
/work/u-boot/arch/arm/cpu/armv7/omap3/board.c:314: undefined reference to
`omap_nand_switch_ecc'
make[1]: *** [/work/u-boot/spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl.bin] Error 2
which shows that without remove undef patch do_switch_ecc() function is
preserved while with this patch it's garbage collected).
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 ;) )
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...
Regards, Ilya.
More information about the U-Boot
mailing list