This is the mail archive of the
mailing list for the binutils project.
Re: Adding MIPS support to GOLD
- From: Ian Lance Taylor <iant at google dot com>
- To: Rick Mann <rmann at latencyzero dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 25 Mar 2008 10:49:16 -0700
- Subject: Re: Adding MIPS support to GOLD
- References: <E3BB9705-87B9-4E9C-B234-52D23319A440@latencyzero.com>
Rick Mann <email@example.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
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.