This is the mail archive of the binutils@sources.redhat.com 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: static lib drops objects with side-effects


Alan Modra <amodra@bigpond.net.au> writes:

> On Mon, Feb 10, 2003 at 05:03:04PM +0100, Wesley W. Terpstra wrote:
>> This is a bug.
>
> No it isn't.  Objects are extracted from archives during linking only
> if the object contains a symbol satisfying an undefined symbol
> reference.  If this behaviour is incompatible with your C++ model then
> don't use archives.

This reminds me that I have wanted for some time to complain about the
converse behavior: if you are using shared objects and you put say -lm
on the link line, a NEEDED entry for libm.so will appear in the linked
object even if libm.so doesn't satisfy undefined symbol references.  I
consider this to be wrong, because people tend to throw libraries onto
their link lines just because they exist, assuming that ld will ignore
them if they don't provide any useful symbols.

zw


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