This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ld problems creating shared libraries


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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]