static lib drops objects with side-effects

Hans-Peter Nilsson hp@bitrange.com
Wed Feb 12 12:20:00 GMT 2003


On Tue, 11 Feb 2003, Zack Weinberg wrote:
> 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.

You might have considered it but anyway: this means a noticeable
functionality change.  I think that with your proposed change,
if you had an undefined weak in your program, and a new version
of the DSO has a definition of that symbol, you'll notice an ld
functionality change, requiring relinking the program to get the
"old" behavior.  Right, the major version on the DSO should have
been updated for such a change.  Still, a change in behavior,
wanted or not, obscure or not.

brgds, H-P



More information about the Binutils mailing list