This is the mail archive of the
mailing list for the binutils project.
Re: linker problem: relocation truncated to fit
- To: Ryan Murray <rmurray at cyberhqz dot com>
- Subject: Re: linker problem: relocation truncated to fit
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Sun, 16 Sep 2001 15:50:03 -0700
- Cc: linux-mips at oss dot sgi dot com, binutils at sourceware dot cygnus dot com,gcc at gcc dot gnu dot org
- References: <20010916091654.C1812@lucon.org> <Pine.BSO.email@example.com> <20010917000719.B25531@false.linpro.no> <20010916153857.H22750@cyberhqz.com>
On Sun, Sep 16, 2001 at 03:38:57PM -0700, Ryan Murray wrote:
> On Mon, Sep 17, 2001 at 12:07:19AM +0200, Petter Reinholdtsen wrote:
> > [Wilbern Cobb]
> > > 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.
> > I tried -G4, -G2 and -G1 without any luck. Even with -G1 there are still
> I don't think -G is the problem here. The problem is that the GOT
> needs to be bigger than a 16 bit value. The only way to do this is to
> recompile everything that is going to be linked in statically
> (libc_noshared.a and libgcc.a included) with -Wa,-xgot This problem
> currently affects openh323 and mozilla, among other things.
I don't think mips is the only platform which has this problem. Do
Alpha, PowerPC and Sparc have similar problems like that? What are
the solutions for them?
BTW, it sounds like the -fpic vs. -fPIC issue.