Brian Callahan <bcallah <at> devio.us> writes:

> Woah. Cool! Got this built on my loongson.
> One of the tests fails on loongson (I don't know what it looks like on 
> other archs) but I don't think that's a reason not to get this in.
> ok for me if someone wants to commit.

(for archive)

http://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html

-mxgot
-mno-xgot

Lift (do not lift) the usual restrictions on the size of the global
offset table.

GCC normally uses a single instruction to load values from the GOT.
While this is relatively efficient, it only works if the GOT is smaller
than about 64k. Anything larger causes the linker to report an error
such as:

  relocation truncated to fit: R_MIPS_GOT16 foobar

If this happens, you should recompile your code with -mxgot. This works
with very large GOTs, although the code is also less efficient, since it
takes three instructions to fetch the value of a global symbol.

Note that some linkers can create multiple GOTs. If you have such a
linker, you should only need to use -mxgot when a single object file
accesses more than 64k's worth of GOT entries. Very few do.

These options have no effect unless GCC is generating position
independent code.

Reply via email to