Adding MIPS support to GOLD

Ian Lance Taylor iant@google.com
Tue Mar 25 18:30:00 GMT 2008


Rick Mann <rmann@latencyzero.com> writes:

> What would it take to add MIPS support? We work on a large embedded
> platform (designed in-house) that uses both ia32 and MIPS. Our builds
> take FOR-E-VER, and linking is a big part of that.
>
> I have no idea what's involved in targeting a new architecture. How
> hard is it?

That's an excellent question, and I encourage you to find out.

Basically you have to implement the interface in target.h.  It should
be pretty easy to get the basic stuff working.  i386.cc is 2466 lines
long.  About 10% of that is C++ boilerplate and about 20% of it is TLS
support.

As David says, MIPS uses multi-GOT.  Without actually looking into it,
I think that should actually be fairly simple.  gold provides basic
GOT classes in output.h, and Cary just added GOT types on a per-symbol
basis.  Other than that, gold doesn't know about the GOT outside of
the target specific code.  The MIPS backend should be able to just
track the different GOT sections itself.  I hope.

Ian



More information about the Binutils mailing list