[i386] Why g++ _always_ link an executable with libm.so?

Mike Hearn mike@navi.cx
Wed Jan 5 20:06:00 GMT 2005


On Wed, 2005-01-05 at 13:48 -0500, Andrew Pinski wrote:
> Again why are you complaining when a good dynamic loader will not load
> the needed libraries unless they are really needed?

You can't do that for ELF, you have no idea what libraries symbols are
meant to come from. The NEEDED entries in a binary are how the loader
knows what's needed and what's not, as the name implies. There's no way
to strip these entries once the binary has been built (except taking
them away one at a time and seeing if anything breaks ...) so it's
better if the compiler/linker does it.



More information about the Gcc mailing list