This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Statically linking against a shared library
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Thorsten Glaser <tg at 66h dot 42h dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Sun, 13 Mar 2005 13:31:31 +1030
- Subject: Re: Statically linking against a shared library
- References: <Pine.BSO.4.61L.0503122203030.11523@odem.66h.42h.de>
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