This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How feasible is it to port gold to mingw?


NightStrike <nightstrike@gmail.com> writes:

> On Mon, Dec 6, 2010 at 6:43 PM, Ian Lance Taylor <iant@google.com> wrote:
>> NightStrike <nightstrike@gmail.com> writes:
>>
>>> I would think that if it's written in C++ in a true object oriented
>>> form, that it would be easy to derive a new target from an existing
>>> template using some random appropriate design pattern.
>>
>> No. ÂThis assumes that linking ELF is fundamentally the same as linking
>> PE-COFF. ÂIt is not. ÂThe shared library model is completely different.
>> I suspect that a PE-COFF linker needs fewer passes; in particular I
>> suspect that it does not need a second pass over the input files
>> gathering relocation information.
>
> How does ld handle multiple formats?

The original GNU ld, in 1991, used a target-independent linking
approach.  That approach was never ported to ELF, and was far too slow
for actual use with athe targets it did support (a.out and COFF).  I
rewrote it around 1994 or so (based on a design by Steve Chamberlain) to
what is, in effect, a separate linker for each object file format.  GNU
ld currently uses a common set of entry points, but the actual linking
code is object-format specific.  That approach was ported to ELF, where
it turned out to be a poor fit; that poor fit between ELF and GNU ld is
a big part of why gold is faster.  There are more details in my gcc
summit paper.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]