MIPS gas/ld -xgot handling is broken for at least mips*-linux
Thiemo Seufer
ica2_ts@csv.ica.uni-stuttgart.de
Wed Aug 18 17:57:00 GMT 2004
David Daney wrote:
> Thiemo Seufer wrote:
> > Hello All,
> >
> > since the introduction of multi-got in the mips gas/ld the -xgot
> > option breaks in ld as soon as the GOT size grows over the
> > (single-GOT) 64 kB limit. ld tries to handle it as multi-GOT
> > instead of a large single GOT.
> >
> > I see two approaches to fix this:
> > - Disallow the -xgot option for traditional mips. The appended patch
> > does so. This will leave SGI-style configurations broken. On IRIX,
> > this would imply using the native ld.
> > - Let ld handle xgot compiled code as large single GOT again. For this,
> > it needs either some xgot flag, or has to generally disable multi-GOT
> > for SGI-style configurations. The elf header provides a EF_MIPS_XGOT
> > flag, but this isn't set by gas yet.
> >
> > I tend to do the first because I don't know if xgot ever really
> > worked on linux. Comments?
> >
>
> On mipsel-linux (and the untested mips-linux configuration):
>
> The java support in gcc-3.4.x and beyond currently uses the compiler's
> -mxgot flag which generates large got code via explicit relocs.
>
> Earlier private versions of this support for gcc-3.3 use the gas -xgot
> option.
>
> We are forced to do this (I think) due to the screwed up way that
> libtool generates the libgcj.so shared library (piece-wise linking due
> to command line length restrictions).
Hm, the multi-GOT support in gas/ld is supposed to handle this well.
> I have not observed any problems doing this with binutils 2.15 (perhaps
> I am lucky).
If the final link creates a GOT of less than 64 kB size, it may work.
> So if there is really a problem in ld with large got support, I would
> rather see it fixed rather than disallow large gots.
>
> I believe that other libraries may also use -xgot due to the same
> libtool issues (KDE or Gnome IIRC).
I know that mozilla-firefox uses -xgot and fails for a large shared
library. The smaller binaries seem to be ok.
Thiemo
More information about the Binutils
mailing list