This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld problems creating shared libraries
- To: Martin Waller <martin dot waller at seagatesoftware dot com>
- Subject: Re: ld problems creating shared libraries
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Wed, 31 Jan 2001 16:39:20 -0800
- Cc: "'binutils at sourceware dot cygnus dot com'" <binutils at sourceware dot cygnus dot com>
- References: <81E198609B9DD311BE0A00508B5E2984ED8B2F@ipsent02.camelot.seagatesoftware.com>
On Tue, Jan 30, 2001 at 05:04:41AM -0800, Martin Waller wrote:
> Hello,
>
> I'm trying to use ld (GNU ld version 2.9.5 (with BFD 2.9.5.0.22)) to create
> a shared library by using the -shared command line option. This on its own
> seems to work fine but then I want to resolve symbols within the library
> against the library and not against symbols in the main program. To do this
> I add the -Bsymbolic flag. At this point I get a whole load of unresolved
> symbols which I'm not expecting; I would expect all these symbols to be
> resolved at load time.
>
> This technique seems to work fine on other platforms, SUN etc, but fails
> here ?
>
> Does anyone have any ideas ?
>
Assuming you are using Linux since you mentioned 2.9.5.0.22,
1. You should use binutils 2.10.1.0.4.
2. You should use "gcc -shared", not "ld -shared".
3. You can try "-Wl,---noinhibit-exec" and ignore the unresolved
symbol errors.
--
H.J. Lu (hjl@valinux.com)