RE: Why -mxgot on MIPS and not -fpic/-fPIC?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Florian Weimer <fw@xxxxxxxxxxxxx> writes:
> It looks like -mxgot has a similar impact on MIPS as using -fPIC
> (instead of -fpic) on other architectures.
> 
> Why wasn't the -fpic/-fPIC distinction carried over to MIPS?

Much of the history here is probably folklore and guesswork but for
my understanding is that MIPS has three levels of 'pic'.

MIPS PIC code is really controlled by -mabicalls and -mshared which
I assume originate from the MIPS-pro days.

-fpic is simply set to imply -mabicalls and -mshared which is where
everything gets far more confusing (but let's not get into that
unless we have to)

The reason there is no -fPIC is probably a conscious decision as
MIPS has 'multi-got' that allows the small -fpic model to scale to
most situations.

-mxgot (aka big-got) is however a good match for -fPIC as it is a
model guaranteed to work irrespective of how big the GOT is.

I do have a report to deal with about -fPIC and the value it sets
for __PIC__ because it always sets '1' due to not supporting -fPIC.
It is tempting to just make -fPIC imply -mxgot and set __PIC__ to 2
but it will lead to bloated code in a number of cases where
multi-got is sufficient.

This is one of several conflicted issues for MIPS that has no
obvious right answer.

Matthew




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux