public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Fix all linker scripts for older binutils versions (pre-2.16)
Date: Fri, 21 Aug 2009 23:14:03 +0200	[thread overview]
Message-ID: <20090821211403.39522833DBD2@gemini.denx.de> (raw)
In-Reply-To: <1250510453-30567-1-git-send-email-wd@denx.de>


In message <1250510453-30567-1-git-send-email-wd@denx.de> I wrote:
> Commit f62fb99941c6 fixed handling of all rodata sections by using a
> wildcard combined with calls to ld's builtin functions SORT_BY_ALIGNMENT()
> and SORT_BY_NAME().  Unfortunately these functions were only
> introduced with biunutils version 2.16, so the modification broke
> building with all tool chains using older binutils.
> 
> This patch makes it work again.  This is done by omitting the use of
> these functions for such old tool chains.  This will result in
> slightly larger target binaries, as the rodata sections are no longer
> in optimal order alignment-wise which reauls in unused gaps, but the
> effect was found to be insignificant - especially compared to the fact
> that you cannot build U-Boot at all in the current state.
> 
> As ld seems to have no support for conditionals we run the linker
> script through the C preprocessor which can be easily used to remove
> the unwanted function calls.
> 
> Note that the C preprocessor must be run with the "-ansi" (or a
> "-std=") option to make sure all the system-specific predefined
> macros outside the reserved namespace are suppressed. Otherise, cpp
> might for example substitute "powerpc" to "1", thus corrupting for
> example "OUTPUT_ARCH(powerpc)" etc.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Mike Frysinger <vapier@gentoo.org>
> ---
> Compile tested on ARM and PPC, with ELDK 3.1, 3.1.1, 4.1 and 4.2,
> on ARM both with and without USE_PRIVATE_LIBGCC=yes.
> 
> I'm not sure if this is to be considered a bug fix (if you have to
> use an older tool chain, it certainly solves a serious problem of the
> current code) and should go into the current release, or if we should
> rather wait with this for the next version.  Comments welcome.
> 
> 
> Mike, I am aware that Blackfin is already using the C preprocessor to
> generate it's linker scripts. I guess this step can now be folded into
> this general mechanism. Do you want to provide such a patch, or shall
> I do it?
> 
> 
>  Makefile                                      |   15 +++++++++++----
>  board/netstar/Makefile                        |    9 ++++++---
>  board/voiceblue/Makefile                      |   11 +++++++----
>  config.mk                                     |   12 +++++++++++-
>  nand_spl/board/amcc/acadia/Makefile           |    7 +++++--
>  nand_spl/board/amcc/bamboo/Makefile           |    7 +++++--
>  nand_spl/board/amcc/canyonlands/Makefile      |    7 +++++--
>  nand_spl/board/amcc/kilauea/Makefile          |    7 +++++--
>  nand_spl/board/amcc/sequoia/Makefile          |    7 +++++--
>  nand_spl/board/freescale/mpc8313erdb/Makefile |    7 +++++--
>  nand_spl/board/freescale/mx31pdk/Makefile     |    7 +++++--
>  nand_spl/board/samsung/smdk6400/Makefile      |    7 +++++--
>  nand_spl/board/sheldon/simpc8313/Makefile     |    7 +++++--
>  onenand_ipl/board/apollon/Makefile            |    7 +++++--
>  15 files changed, 86 insertions(+), 33 deletions(-)

Applied.

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
"Do we define evil as the absence of goodness? It seems only  logical
that shit happens--we discover this by the process of elimination."
                                                        -- Larry Wall

  parent reply	other threads:[~2009-08-21 21:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 12:00 [U-Boot] [PATCH] Fix all linker scripts for older binutils versions (pre-2.16) Wolfgang Denk
2009-08-17 19:14 ` Mike Frysinger
2009-08-17 19:31   ` Wolfgang Denk
2009-08-17 20:15     ` Mike Frysinger
2009-08-17 20:24       ` Wolfgang Denk
2009-08-17 20:31         ` Mike Frysinger
2009-08-21 21:14 ` Wolfgang Denk [this message]
2009-08-22 23:50 ` [U-Boot] [PATCH] Blackfin: use common code to preprocess linker script Mike Frysinger
2009-08-23 20:25   ` Wolfgang Denk
2009-08-23  0:00 ` [U-Boot] [PATCH] Fix all linker scripts for older binutils versions (pre-2.16) Mike Frysinger
2009-08-23  5:34   ` Wolfgang Denk
2009-08-23  6:09     ` Mike Frysinger
2009-08-23 19:30       ` Wolfgang Denk
2009-08-23  6:47     ` [U-Boot] [PATCH] start a linker script helper file Mike Frysinger
2009-08-23 20:41       ` Wolfgang Denk

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=20090821211403.39522833DBD2@gemini.denx.de \
    --to=wd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox