[U-Boot] [PATCH] Introduce a new linker flag LDFLAGS_FINAL
Wolfgang Denk
wd at denx.de
Mon Jan 31 21:30:41 CET 2011
Dear Haiying Wang,
In message <1296504850.2049.434.camel at haiying-laptop> you wrote:
>
> > If you introduce a new LDFLAGS_FINAL instead, then why do we have to
> > keep LDFLAGS_u-boot - isn't LDFLAGS_u-boot also for "final" linking of
> > the U-Boot image?
> LDFLAGS_FINAL does not provide the whole set of linker options to U-Boot
> image, so it does not replace the LDFLAGS_u-boot, in patch:
I have problems to understan the intentions behind all these many
different linker flag settings, nd this while we are discussing it.
In two weeks from now I will understand none of this any more.
Either this can be made simpler. If you are sure this is not
possible, then we need some detailed documentation of all this, at
least in the README, but eventually as a separate doc/README.*
> > > LDFLAGS += $(PLATFORM_LDFLAGS)
> > > +LDFLAGS_FINAL += -Bstatic $(LDFLAGS)
> > >
> > > -LDFLAGS_u-boot += -Bstatic -T $(obj)u-boot.lds $(PLATFORM_LDFLAGS)
> > > +LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
> >
> > Is it intentional that you change PLATFORM_LDFLAGS into LDFLAGS here?
> Yes. it LDFLAGS_FINAL here includes "-Bstatic $(PLATFORM_LDFLAGS)".
No. Pleasse see 5 lines above: it is "-Bstatic $(LDFLAGS)".
> > Are you sure that this change is correct for all affected boards?
> Can not 100% sure because I can not test all the affected boards.
Yes, you can. Run MAKEALL for all ppc boards and compare the
System.map and u-boot.map files before and after your change. This is
still no guarantee to cover 100% of the potential issues, but as close
as we can get with reasonable effort.
> > How has this change been tested?
> I only can test powerpc by MAKEALL.
> > > +LDFLAGS_spl := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS_FINAL)
> >
> > Arghhh... Here you introduce yet another setting, LDFLAGS_spl ?
> This is an intentional name change. LDFLAGS_spl is used here as LDFLAGS_u-boot, but for nand spl linkage. Actually it is not a new FLAGS, just add *_spl* here so that it can be differed from the LDFlAGS in toplevel config.mk.
>
> > This is not mentioned in the commit message. And why do we need it?
> > Isn't LDFLAGS_FINAL enough?
> As said, it is not a new flag, just a name change.
Anyway. It was not mentioned in the commit message, and not explained
anywhere else.
We _really_ need to thoroughly document all this stuff or soon nobody
will understand nothing of this anymore.
> > Will I soon see patches to also add LDFLAGS_tpl?
> Yes, in patch 3/6.
:-(
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You cannot propel yourself forward by patting yourself on the back.
More information about the U-Boot
mailing list