Statically linking against a shared library

Alan Modra amodra@bigpond.net.au
Sun Mar 13 03:01:00 GMT 2005


On Sat, Mar 12, 2005 at 10:09:50PM +0000, Thorsten Glaser wrote:
> I'd like to ask if someone (besides me) has ever wished to link in
> a shared library statically.

Yes, other people have wanted to do that.  Some even want to link
fully linked executables into their apps.  It just won't work.
At least not without emulating ld.so's behaviour in ld, which isn't
a sane idea.

> The most common use case would be you've got a shared library
> (no matter whether it's .DLL, .so or .dylib) whose static
> counterpart you don't have or won't get (for some reason, which
> to discuss is not the task here), and you'd like to link a
> programme against it, in order to distribute the programme, but
> not the shared library.

Sounds counter to the aims of free software.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list