ld problems creating shared libraries

H . J . Lu hjl@valinux.com
Wed Jan 31 16:40:00 GMT 2001


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)


More information about the Binutils mailing list