This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Problem resolving symbol in object indirectly included by another object.
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Wayne Johnson <wdtj at yahoo dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 8 Jan 2004 12:44:04 -0800
- Subject: Re: Problem resolving symbol in object indirectly included by another object.
- References: <20040107203831.26821.qmail@web13908.mail.yahoo.com>
On Wed, Jan 07, 2004 at 12:38:31PM -0800, Wayne Johnson wrote:
> I'm not sure if this is a fault or feature. It does appear to operate
> different than other platforms we're using...
>
> We have a shared object (call it A) that is linked with code in a static
> archive (call this B). There are function calls in B that refer to
> functions in libxml2.a (another static library). There are no calls to
> libxml2 directly from our code in the objects included in our shared
> object (A).
>
> When I attempt to load the shared object, I get an error that a symbol
> (xmlFree) that should have been resolved by including the libxml2 library
> in the link of the shared object is undefined. Using ldd and objdump,
> this is confirmed.
>
> I linked with a map of the shared object, it shows that libxml2.a is
> loaded but there is no indication that the symbol(s) were resolved. No
> errors either.
>
> If we put an unused libxml2 call in these objects, everything works fine.
>
> Shouldn't a function call to a static archive that contains a function
> call to another static archive work?
>
> I've tried this in binutils-2.9.5 (RH6.2) and binutils-2.11.93 (RH7.3).
>
> Any ideas? Is this a bug? Feature? Cockpit error? Thanks.
>
It works for me. You didn't provide a testcase. I can only guess that
you used "-lxml2 -lB". You should use "-lB -lxml2".
H.J.