public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@wasabisystems.com>
To: Starling <wassdamo@pacbell.net>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Efficient linking
Date: Thu, 11 Sep 2003 20:03:00 -0000	[thread overview]
Message-ID: <m3n0dbrt37.fsf@gossamer.airs.com> (raw)
In-Reply-To: <87u17j7afx.fsf@pacbell.net>

Starling <wassdamo@pacbell.net> 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

  reply	other threads:[~2003-09-11 20:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-11 19:59 Starling
2003-09-11 20:03 ` Ian Lance Taylor [this message]
2003-09-11 22:06   ` Starling
2003-09-12 12:42     ` Eljay Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3n0dbrt37.fsf@gossamer.airs.com \
    --to=ian@wasabisystems.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=wassdamo@pacbell.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).