From: Ralf Baechle <ralf@oss.sgi.com>
To: Wilbern Cobb <cobb@cn.csoft.net>
Cc: "H . J . Lu" <hjl@lucon.org>,
Petter Reinholdtsen <pere@hungry.com>,
linux-mips@oss.sgi.com
Subject: Re: linker problem: relocation truncated to fit
Date: Mon, 17 Sep 2001 03:50:40 +0200 [thread overview]
Message-ID: <20010917035040.A24278@dea.linux-mips.net> (raw)
In-Reply-To: <Pine.BSO.4.33.0109161323280.14503-100000@oddbox.cn>; from cobb@cn.csoft.net on Sun, Sep 16, 2001 at 01:29:38PM -0300
On Sun, Sep 16, 2001 at 01:29:38PM -0300, Wilbern Cobb wrote:
> This is a `feature' of the MIPS toolchain. Global and static items <= n
> bytes are placed into the small data or small bss sections instead of
> the normal data or bss sections as an optimization. Excess items would
> cause these linker errors.
>
> Pass the compiler the -Gn flag (default is 8 bytes), ie. -G4 should work
> for most purposes.
Default is -G0 because GP optimization isn't supported with SVR4 PIC code.
SVR4 code uses the $gp register as a pointer to the middle of a 64kbyte
sized data segment called GOT, global offset table. A GOT overflow results
in obscure error messages as you observe them.
The only easy way to get around this is -Wa,-xgot and making sure that all
the static objects like libgcc which can't be rebuilt easily with -Wa,-xgot
get linked in first. More effort is splitting files with this problem into
multiple shared libraries each below the critical size but this usually
results in better code.
The best solution which currently isn't supported by binutils is a multi-got
code model.
Ralf
prev parent reply other threads:[~2001-09-17 1:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-16 12:17 linker problem: relocation truncated to fit Petter Reinholdtsen
2001-09-16 16:16 ` H . J . Lu
2001-09-16 16:29 ` Wilbern Cobb
2001-09-16 16:29 ` Wilbern Cobb
2001-09-16 22:07 ` Petter Reinholdtsen
2001-09-16 22:38 ` Ryan Murray
2001-09-16 22:50 ` H . J . Lu
2001-09-17 1:55 ` Ralf Baechle
2001-09-17 22:40 ` Richard Henderson
2001-09-17 22:53 ` H . J . Lu
2001-09-17 22:56 ` Richard Henderson
2001-09-17 23:06 ` H . J . Lu
2001-09-17 23:01 ` Jakub Jelinek
2001-09-17 22:47 ` Richard Henderson
2001-09-17 22:56 ` Jakub Jelinek
2001-09-20 22:52 ` Geoff Keating
2001-09-26 10:08 ` Erik Corry
2001-09-16 22:50 ` Wilbern Cobb
2001-09-16 22:50 ` Wilbern Cobb
2001-09-17 1:50 ` Ralf Baechle [this message]
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=20010917035040.A24278@dea.linux-mips.net \
--to=ralf@oss.sgi.com \
--cc=cobb@cn.csoft.net \
--cc=hjl@lucon.org \
--cc=linux-mips@oss.sgi.com \
--cc=pere@hungry.com \
/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