All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6 V3] common: Add symbol handling for generic lists into Makefile
Date: Mon, 15 Oct 2012 03:49:25 +0200	[thread overview]
Message-ID: <201210150349.25232.marex@denx.de> (raw)
In-Reply-To: <CACUy__Wnc2m31swNLiZwhC+TCVViDJpiZWxPapig2g4uAxLi5A@mail.gmail.com>

Dear Daniel Schwierzeck,

> 2012/10/12 Marek Vasut <marex@denx.de>:
> > This patch adds essential components for generation of the contents of
> > the linker section that is used by the linker-generated array. All of
> > the contents is held in a separate file, u-boot.lst, which is generated
> > at runtime just before U-Boot is linked.
> > 
> > The purpose of this code is to especially generate the appropriate
> > boundary symbols around each subsection in the section carrying the
> > linker-generated arrays. Obviously, the interim linker code for actual
> > placement of the variables into the section is generated too. The
> > generated file, u-boot.lst, is included into u-boot.lds via the linker
> > INCLUDE directive in u-boot.lds .
> > 
> > Adjustments are made in the Makefile and spl/Makefile so that the
> > u-boot.lds and u-boot-spl.lds depend on their respective .lst files.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Joe Hershberger <joe.hershberger@gmail.com>
> > Cc: Mike Frysinger <vapier@gentoo.org>
> > 
> > Cover-letter:
> > Linker-generated arrays (take 2)
> > 
> > This is a second stab at the linker-generated array. Basically, this
> > concept is a generic abstraction of how u_boot_cmd works today. The
> > patch 2/4 contains a huge pile of documentation which should clarify
> > most of the questions.
> > 
> > I don't see size growth, I see size fluctiation in the order of tens
> > of bytes with these patches applied. Subsequent patch added to this
> > series removes the __u_boot_cmd section completely.
> > ---
> > 
> >  .gitignore                                     |    1 +
> >  Makefile                                       |   19 ++++---
> >  config.mk                                      |    2 +
> >  helper.mk                                      |   64
> >  ++++++++++++++++++++++++ nand_spl/board/freescale/mpc8536ds/Makefile   
> >  |    9 +++-
> >  nand_spl/board/freescale/mpc8569mds/Makefile   |    9 +++-
> >  nand_spl/board/freescale/mpc8572ds/Makefile    |    9 +++-
> >  nand_spl/board/freescale/mx31pdk/Makefile      |    9 +++-
> >  nand_spl/board/freescale/p1010rdb/Makefile     |    9 +++-
> >  nand_spl/board/freescale/p1023rds/Makefile     |    9 +++-
> >  nand_spl/board/freescale/p1_p2_rdb/Makefile    |    9 +++-
> >  nand_spl/board/freescale/p1_p2_rdb_pc/Makefile |    9 +++-
> >  nand_spl/board/karo/tx25/Makefile              |    9 +++-
> >  spl/.gitignore                                 |    1 +
> >  spl/Makefile                                   |    8 ++-
> >  15 files changed, 150 insertions(+), 26 deletions(-)
> >  create mode 100644 helper.mk
> > 
> > V2:
> > - Rebase on top of testing/dm-kerneldoc
> > - Fix INCLUDE u-boot.lds in linker scripts. It didn't work with older LD,
> > 
> >   use #include instead and make use of CPP.
> > 
> > - Fix placement of u-boot.lds for NAND SPL
> > V3:
> > - Rebase on top of u-boot/next
> > - Put u-boot.lst into include/ , so the CPP finds it easily.
> > 
> > diff --git a/.gitignore b/.gitignore
> > index d91e91b..1ac43f2 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -38,6 +38,7 @@
> > 
> >  /u-boot.sha1
> >  /u-boot.dis
> >  /u-boot.lds
> > 
> > +/u-boot.lst
> > 
> >  /u-boot.ubl
> >  /u-boot.ais
> >  /u-boot.dtb
> > 
> > diff --git a/Makefile b/Makefile
> > index ab34fa7..66c8c77 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -535,7 +535,10 @@ else
> > 
> >  GEN_UBOOT = \
> >  
> >                 UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
> >                 sed  -n -e
> >                 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`
> >                 ;\
> > 
> > -               cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F))
> > $$UNDEF_SYM $(__OBJS) \ +               UNDEF_LST=`$(OBJDUMP) -x
> > $(LIBBOARD) $(LIBS) | \ +               sed  -n -e
> > 's/.*\($(SYM_PREFIX)__u_boot_list_.*\)/-u\1/p'|sort|uniq`;\
> 
> this must be:
> > +               sed  -n -e
> > 's/.*\($(SYM_PREFIX)_u_boot_list_.*\)/-u\1/p'|sort|uniq`;\

I suspect this might break blackfin.

> otherwise $UNDEF_LST is always empty which breaks at least all MIPS
> boards because
> all _uboot_list_* symbols are discarded by the linker. I noticed that
> on ARM and PowerPC
> the content of $UNDEF_LST does not matter at all because those symbols
> are always linked into the final binary.

About time to fix mips ... or throw it away altogether, until it learns to do 
stuff right (incl. relocation).

> I've pushed debug patches to git://git.denx.de/u-boot-mips.git
> test/dm-lgarray-fixed
> if you want to test it yourself. With those patches make and MAKEALL will
> fail if the _uboot_list_cmd_* symbols are missing in the System.map.

I will check it, thanks.

> BTW: you could actually drop this in patch 5/5 because it's not needed 
anymore:
> >                 UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
> >                 sed  -n -e
> >                 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`
> >                 ;\

Good point.

Best regards,
Marek Vasut

  reply	other threads:[~2012-10-15  1:49 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-30  0:17 [U-Boot] [PATCH 0/5] Linker-generated arrays (take 2) Marek Vasut
2012-09-30  0:17 ` [U-Boot] [PATCH 1/5] common: Add symbol handling for generic lists into Makefile Marek Vasut
2012-10-02 23:40   ` Joe Hershberger
2012-09-30  0:17 ` [U-Boot] [PATCH 2/5] common: Implement support for linker-generated arrays Marek Vasut
2012-10-02 23:40   ` Joe Hershberger
2012-09-30  0:17 ` [U-Boot] [PATCH 3/5] common: Add .u_boot_list into all linker files Marek Vasut
2012-10-02 23:41   ` Joe Hershberger
2012-10-03 14:55   ` Daniel Schwierzeck
2012-10-03 15:01     ` Marek Vasut
2012-10-03 15:21       ` Daniel Schwierzeck
2012-10-03 16:44         ` Marek Vasut
2012-10-03 18:05           ` Daniel Schwierzeck
2012-10-03 20:49   ` [U-Boot] [PATCH 3/5 V2] " Marek Vasut
2012-09-30  0:17 ` [U-Boot] [PATCH 4/5] common: Convert the U-Boot commands to LG-arrays Marek Vasut
2012-10-02 23:43   ` Joe Hershberger
2012-09-30  0:17 ` [U-Boot] [PATCH 5/5] common: Discard the __u_boot_cmd section Marek Vasut
2012-10-02 23:43   ` Joe Hershberger
2012-10-03 14:56   ` Daniel Schwierzeck
2012-10-03 20:50   ` [U-Boot] [PATCH 5/5 V2] " Marek Vasut
2012-10-07  0:06 ` [U-Boot] [PATCH 0/6 V2] Linker-generated arrays (take 2) Marek Vasut
2012-10-07  0:06   ` [U-Boot] [PATCH 1/6 V2] common: Add symbol handling for generic lists into Makefile Marek Vasut
2012-10-07  0:06   ` [U-Boot] [PATCH 2/6 V2] common: Implement support for linker-generated arrays Marek Vasut
2012-10-07  0:06   ` [U-Boot] [PATCH 3/6 V2] common: Add .u_boot_list into all linker files Marek Vasut
2012-10-07  0:06   ` [U-Boot] [PATCH 4/6 V2] common: Convert the U-Boot commands to LG-arrays Marek Vasut
2012-10-07  0:06   ` [U-Boot] [PATCH 5/6 V2] common: Discard the __u_boot_cmd section Marek Vasut
2012-10-07  0:06   ` [U-Boot] [PATCH 6/6 V2] kerneldoc: tmpl: Implement template for LG-arrays Marek Vasut
2012-10-12 20:27   ` [U-Boot] [PATCH 0/6 V3] Linker-generated arrays (take 2) Marek Vasut
2012-10-12 20:27     ` [U-Boot] [PATCH 1/6 V3] common: Add symbol handling for generic lists into Makefile Marek Vasut
2012-10-14 23:28       ` Daniel Schwierzeck
2012-10-15  1:49         ` Marek Vasut [this message]
2012-10-15  2:04           ` Daniel Schwierzeck
2012-10-15  2:09             ` Marek Vasut
2012-10-17 10:43       ` [U-Boot] [PATCH 1/6 V4] " Marek Vasut
2012-10-18 19:40         ` Wolfgang Denk
2012-10-19 13:19           ` Marek Vasut
2012-10-20 17:46             ` Tom Rini
2012-10-20 18:56               ` Marek Vasut
2012-10-21  5:20                 ` Tom Rini
2012-10-19 15:00         ` [U-Boot] [PATCH 1/6 V5] " Marek Vasut
2012-10-19 15:45           ` Joe Hershberger
2012-10-19 15:48           ` Joe Hershberger
2012-10-22 21:04           ` Tom Rini
2012-10-12 20:27     ` [U-Boot] [PATCH 2/6 V3] common: Implement support for linker-generated arrays Marek Vasut
2012-10-12 20:27     ` [U-Boot] [PATCH 3/6 V3] common: Add .u_boot_list into all linker files Marek Vasut
2012-10-12 20:27     ` [U-Boot] [PATCH 4/6 V3] common: Convert the U-Boot commands to LG-arrays Marek Vasut
2012-10-12 20:27     ` [U-Boot] [PATCH 5/6 V3] common: Discard the __u_boot_cmd section Marek Vasut
2012-10-17 10:45       ` [U-Boot] [PATCH 5/6 V4] " Marek Vasut
2012-10-12 20:27     ` [U-Boot] [PATCH 6/6 V3] kerneldoc: tmpl: Implement template for LG-arrays Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201210150349.25232.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.