On Tue, 20 Jul 2010, David Daney wrote:
I would note that GCC/Binutils has for quite some time had the -mxgot option
(or a variant thereof), which lifts the got size restriction at the expense of
less efficient code. I would be inclined to recommend using it instead of
cooking up a solution for multiple GOTs within a single function. It has the
advantage that it exists and works today.
Support for large GOT has been defined since the beginning of the MIPS
ELF ABI (GOTHI16/GOTLO16 relocations etc.), but I have been told it
requires all the dependent libraries (down to libc) to be rebuilt (never
analysed that myself), at which point you have to rebuild the whole system
or create another set of multilibs. Given a large GOT has a considerable
performance hit, it does not sound like a good idea to make all the
programs in a system suffer to serve the few offenders.
It might be nice to add a function attribute that lets us turn -mxgot on and
off on a per function basis, instead of the current per compilation unit basis
of today.
As I say the biggest concern are whole programs and not single functions.
Feel free to implement large GOT support such that mixing objects or even
single functions in a link is possible. How would you determine which
function to annotate with the attribute -- manually by trial and error?
It doesn't seem that would scale well to me. We've been through it with
the -G option.