Why -mxgot on MIPS and not -fpic/-fPIC?
Maciej W. Rozycki
macro@imgtec.com
Mon Oct 3 17:34:00 GMT 2016
On Mon, 3 Oct 2016, Florian Weimer wrote:
> >> GHC produces objects which need -mxgot.
> >
> > Ouch, what a waste of memory!
>
> There might be ways to cut down the number of relocations.
Well, avoiding the use of R_MIPS_GOT_HI16/R_MIPS_GOT_LO16 pairs unless
absolutely necessary is *the* way.
> > This raises a question however: why do you need it in the first place?
> > The only case where multi-got does not work is where you have a single
> > object (.o) file which requires more than 16378 GOT entries (8188 in the
> > n64 ABI case). A GOT entry is required per each individual global symbol
> > and per each 64kB chunk of local (static) symbols -- do you really have
> > such a huge object file? Perhaps you could split the source so that
> > multiple objects are created instead?
>
> Or group multiple related variables in a struct. There are likely
> quite a few ways GHC could generate code leading to improved
> relocations because the DSOs it builds do not have a stable ABI
> anyway. But I bet it's not on the GHC developers' radar screen today
> because other platforms have less stringent limits (but would benefit
> from the RSS reduction as well).
I take it they don't support multi-GOT then, right?
> You'll see that in Fedora eventually. My question was prompted by a
> Debian build failure without -mxgot.
So what did fail to build then? That's ultimately what the question I
asked boils down to.
Maciej
More information about the Gcc-help
mailing list