[U-Boot] Board-specific commands unintentionally linked into SPL?

Tom Rini trini at ti.com
Fri Aug 3 21:23:47 CEST 2012


On Fri, Aug 03, 2012 at 06:40:58PM +0200, Daniel Schwierzeck wrote:
> Hi Tyler,
> 
> 2012/8/3 Tyler Olmstead <tyler.j.olmstead at gmail.com>:
> 
> > Yes, the #ifndef works perfectly for me. However, I also agree with
> > your sentiment regarding build magic, which is why I wonder if
> > removing the $GEN_UBOOT linker magic from the SPL makefile wouldn't be
> > the best approach. If this was done, then my U-Boot command wouldn't
> > have been linked into SPL in the first place, it wouldn't require any
> > cluttering of #ifdef's, and would eliminate the potential of others
> > encountering this same problem. This seems reasonable given that SPL
> > shouldn't contain any command support. Thoughts?
> >
> 
> Most of the spl/Makefile code was copied and adapted from the top Makefile.
> Unfortunately, we have not optimized the GEN_UBOOT macro so it still
> has the UNDEF_SYM magic
> which is obviously unnecessary.
> 
> I would suggest to remove the UNDEF_SYM magic.

So, this is another one of the problems with relying on the linker to
discard stuff that's not needed.  Current omap3_beagle:
Configuring for omap3_beagle board...
   text    data     bss     dec     hex filename
 326264    8460  266916  601640   92e28 omap3_beagle/u-boot
  42856    1812  198020  242688   3b400 omap3_beagle/spl/u-boot-spl

Remove UNDEF_SYM, remove guards around the nandecc command in
arch/arm/cpu/armv7/omap3/board.c:
Configuring for omap3_beagle board...
   text    data     bss     dec     hex filename
 326274    8460  266904  601638   92e26 omap3_beagle/u-boot
  43014    1812  198020  242846   3b49e omap3_beagle/spl/u-boot-spl

So we don't discard the command and SPL grows slightly (confirmed by
still removing UNDEF_SYM but putting the guards back on nandecc).

I don't know if we need to be more aggressive in linker commands or what
but I know there's lots of other code not being discarded too, from when
I poked at NAND before.

-- 
Tom


More information about the U-Boot mailing list