From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] Makefile: Fix linking with modern binutils
Date: Tue, 21 Mar 2017 11:16:50 -0400 [thread overview]
Message-ID: <20170321151650.GC19897@bill-the-cat> (raw)
In-Reply-To: <CAGf6Ps7SKfuLfks7D8LuH_RRfR7J08-b=BsBtcF4J3vWQ5Fr6A@mail.gmail.com>
On Tue, Mar 21, 2017 at 08:59:04AM -0500, Jon wrote:
> Likewise tested on Fedora rawhide with: binutils-2.28-5.fc27
>
> This patch allows our distro u-boot builds to succeed. +1
>
> Tested-by: Jon Disnard <jdisnard@gmail.com>
Has anyone figure out what exactly is going on yet? It's pretty odd to
me that linking at 0x0 (or not) is what's causing new binutils to throw
this particular error out there. Thanks!
>
>
> On Thu, Jan 12, 2017 at 3:19 AM, Sjoerd Simons
> <sjoerd.simons@collabora.co.uk> wrote:
> > Tested on current Debian unstable:
> > GNU ld (GNU Binutils for Debian) 2.27.90.20170109
> >
> > Tested-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> >
> > On Fri, 2016-12-16 at 15:23 +1030, Joel Stanley wrote:
> >> Since Binutils 1a9ccd70f9a7[1] u-boot will not link targets that set
> >> CONFIG_SYS_TEXT_BASE=0 with the following error:
> >>
> >> LD u-boot
> >> arm-linux-gnueabi-ld.bfd: u-boot: Not enough room for program
> >> headers, try
> >> linking with -N
> >> arm-linux-gnueabi-ld.bfd: final link failed: Bad value
> >>
> >> The issue can reproduced the bad binutils and the rock2_defconfig
> >> target.
> >>
> >> This issue was also encountered by the powerpc kernel[2], with the
> >> fix
> >> being to pass --no-dynamic-linker for linkers newer than 2.26 when
> >> this
> >> flag was introduced. The option tells ld that the PIE or shared lib
> >> does
> >> not need loaded program headers.
> >>
> >> Ubuntu Zesty's Binutils 2.27.51.20161202 hits this error.
> >>
> >> [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit
> >> ;h=1a9ccd70f9a7
> >> [2] https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/co
> >> mmit/?h=next&id=ff45000fcb56b5b0f1a14a865d3541746d838a0a
> >>
> >> Signed-off-by: Joel Stanley <joel@jms.id.au>
> >> ---
> >> v2:
> >> - use ld-option to test for the flag instead of the version, as
> >> suggested by MÃ¥ns
> >> - update commit message with clarification from Alan
> >>
> >> Makefile | 4 ++++
> >> 1 file changed, 4 insertions(+)
> >>
> >> diff --git a/Makefile b/Makefile
> >> index dfed58bec661..c98a8361654a 100644
> >> --- a/Makefile
> >> +++ b/Makefile
> >> @@ -793,6 +793,10 @@ ALL-y += $(CONFIG_BUILD_TARGET:"%"=%)
> >> endif
> >>
> >> LDFLAGS_u-boot += $(LDFLAGS_FINAL)
> >> +
> >> +# Avoid 'Not enough room for program headers' error on binutils 2.28
> >> onwards.
> >> +LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker)
> >> +
> >> ifneq ($(CONFIG_SYS_TEXT_BASE),)
> >> LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
> >> endif
> >
> > --
> > Sjoerd Simons
> > Collabora Ltd.
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
>
>
>
> --
>
> -Jon Disnard
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170321/7c5e7140/attachment.sig>
next prev parent reply other threads:[~2017-03-21 15:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-16 4:53 [U-Boot] [PATCH v2] Makefile: Fix linking with modern binutils Joel Stanley
2016-12-26 18:07 ` Tom Rini
2017-01-12 9:19 ` Sjoerd Simons
2017-03-21 13:59 ` Jon
2017-03-21 15:16 ` Tom Rini [this message]
2017-03-21 23:00 ` Nicholas Piggin
2017-03-21 23:13 ` Tom Rini
2017-03-22 12:53 ` Alan Modra
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=20170321151650.GC19897@bill-the-cat \
--to=trini@konsulko.com \
--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