linux-mips
[Top] [All Lists]

RE: "relocation truncated to fit" -- SOLVED!

To: "Thiemo Seufer" <ica2_ts@csv.ica.uni-stuttgart.de>
Subject: RE: "relocation truncated to fit" -- SOLVED!
From: "Brad Barrett" <brad@patton.com>
Date: Fri, 30 May 2003 11:21:53 -0400
Cc: "'Linux-Mips@Linux-Mips. Org'" <linux-mips@linux-mips.org>
Importance: Normal
In-reply-to: <20030527192643.GH18653@rembrandt.csv.ica.uni-stuttgart.de>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
I wanted to make sure I reported back my results...

I updated only binutils to the latest version (2.14.90.0.4), cleaned the source
trees, and rebuilt with success.  This saved me much time that might have been
spent on the -GN or -Wa,xgot workarounds (which might not even have worked).

So thanks a lot Thiemo!

Brad

-----Original Message-----
From: linux-mips-bounce@linux-mips.org
[mailto:linux-mips-bounce@linux-mips.org]On Behalf Of Thiemo Seufer
Sent: Tuesday, May 27, 2003 3:27 PM
To: Brad Barrett
Cc: 'Linux-Mips@Linux-Mips. Org'
Subject: Re: "relocation truncated to fit"


Brad Barrett wrote:
> Preface:
> --------
> I have a userspace toolchain issue.  I'm not sure where to post it, so I'll
> start here.

binutils@sources.redhat.com is probably the better place for this.

[snip]
> I built the cross-tools myself.  They are now about 6-8 months old.  They
> consist of:
> - gcc version 3.2.1 20020903 (prerelease)
> - GNU ld version 2.13.90.0.10 20021010  [from H.J. Lu]
> - glibc version 2.2.5

An upgrade is IMHO the best solution:
gcc 3.3 will fix some "branch out of range" issues, and binutils
newer than 2.13.90.0.18 implement multigot. Both together should
solve the problem.

> What I know:
> ------------
> Googling hasn't turn up much, with the exception of an intriguing exchange
from
> Sept 2001  on this mailing list:

The GOT overflow problem is quite well known, it hits every largish
executable for O32 MIPS. Most notably Mozilla and parts of KDE were
affected, too.

> Petter Reinholdtsen reports similar messages when (native) compiling "a huge
C++
> program" (actually Opera) on an Indy:
> http://www.spinics.net/lists/mips/msg04568.html
>
> Wilbern Cobb suggests using -G4, -G2, or -G1, which Petter reports reduces the
> messages but does not eliminate them.

These reduce GOT usage at the expense of speed and size, so they
help a bit as workaround.

> Then Ryan Murray says that every static
> library used in the link, including libc_noshared.a and libgcc.a, must be
> compiled with -Wa,xgot.

Would also work, but is binary incompatible then.


Thiemo


<Prev in Thread] Current Thread [Next in Thread>