Re: partial linking

Ralf Wildenhues <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization Department of Numerical Simulation, University of Bonn
Message-ID <[email protected]>
Hello Paul,

* Paul Jarc wrote on Fri, Sep 05, 2008 at 05:34:06PM CEST:
> Ralf Wildenhues <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.