Re: Efficient linking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Starling <wassdamo@xxxxxxxxxxx> writes:

> On the subject of incremental linking I did find something saying you
> can go
> ld -r -o piece1.o A.o B.o C.o ...
> ld -r -o piece2.o D.o E.o F.o ...
> ld -o all main.o piece1.o piece2.o
> And that way you don't have to relink D, E, and F when A, B or C
> changes.  However, wouldn't that generate a large object file
> (pieceN.o)?  How is linking piece1.o and piece2.o more efficient than
> linking all of the lesser object files at once?  Is it more efficient,
> or does the linker have to piece together the files just as if they
> were separate?

It's a little bit more efficient, because the linker doesn't have to
open as many files, and because it can read the information in bigger
chunks--that is, all the relocation information will be gathered
together in pieceN.o and can be processed at once rather than being
processed in several different parts.  That may sound completely
trivial, but that kind of thing is what the linker spends a lot of
time doing.

But it's not a lot more efficient.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux