help-gnu-utils
[Top][All Lists]
Advanced

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

Re: partial linking


From: Ralf Wildenhues
Subject: Re: partial linking
Date: Sat, 6 Sep 2008 16:11:27 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Paul,

* Paul Jarc wrote on Fri, Sep 05, 2008 at 05:34:06PM CEST:
> Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote:
> > You did not state what the final link will create.  If it creates a
> > static library, then your approach may introduce larger code into
> > programs that use this library, e.g., because the program really only
> > needs code from a.o but it then gets that from b.o and c.o, too.
> 
> I think that's true for a partially-linked object file, but not for a
> static library created with ar, right?

I think we're agreeing, but to dispell any doubts let me restate what I
meant: if a.o, b.o, c.o get partially linked to r.o which in turn gets
archived in libfoo.a, and program p uses libfoo.a, needing a symbol
originally defined in a.o only, then p may be larger than necessary.

This wouldn't happen if instead a.o, b.o, and c.o get archived into
libfoo.a right away, or by some intermediate archive (which GNU binutils
ld could subsume with --whole-archive into the larger archive).

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]