Problem resolving symbol in object indirectly included by another object.

H. J. Lu hjl@lucon.org
Thu Jan 8 20:44:00 GMT 2004


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.



More information about the Binutils mailing list