This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Adding MIPS support to GOLD
> >> I was thinking about looking at MIPS support, however I think it may
> >> be a bit complicated. The Multi-GOT support is something that does
> >> not exist for x86, so it would be completely new. The rest (having
> >> not looked at the gold source code yet), I think would be mostly
> >> straight forward.
Actually, it shouldn't be that difficult to support multiple GOTs. The
GOT section is just an instance of a class, and the target-independent
parts of gold should be able to handle more than one of them just
fine.
All the target-dependent code in gold is in the source files i386.cc
and x86_64.cc. To add a new target, you'll want to add a new
target-specific source file (e.g., mips.cc) and use one of the
existing ones as your guide. Basically, you'll need to define a new
subclass of Sized_target (see target.h), and implement the public
member functions defined in the base classes Target and Sized_target.
You'll also need a new subclass of Target_selector (see
target-select.h). The most common types of relocations are implemented
in target-independent code in the class Relocate_functions (see
reloc.h), but you'll need to implement MIPS-specific ones in the
target-specific source file.
-cary