This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
how to resolve unresolved symbols
- From: Burlen Loring <burlen dot loring at kitware dot com>
- To: binutils at sourceware dot org
- Date: Wed, 15 Oct 2008 10:33:39 -0400
- Subject: how to resolve unresolved symbols
Hi all,
I have some questions on how to resolve some undefined symbols. I am not
understanding the basic process by which these get defined/resolved, so
I hope I can get some info on how this would happen.
I am trying load a .so external to the code base which it was created
for use with. These are "plugin" objects that are opened using that code
bases plugin manager which internally does its work with dlopen. I have
loaded the plugin within the application it was built for use with and
everything works. When I run my test harness, which uses the
application's plugin manager to open the plugins, I see a dlopen failure
to resolve some symbols. Here is the message.
tycho:~$./PluginManagerTest
Error opening plugin file:
/home/burlen/X/src/plugins/databases/../../lib/libbow.so: undefined
symbol: vtk_zlib_inflateInit_
Invalid plugin: Error opening plugin file for plugin
/home/burlen/ext2/visit/visit1.10.0/src/plugins/databases/libIBOWDatabase.so.
The system error message was
'/home/burlen/X/src/plugins/databases/../../lib/libbow.so: undefined
symbol: vtk_zlib_inflateInit_'.
I would expect this sort of thing because the loader could not find the
right library that the .so referred to in its search path, but when I
use ldd to examine the .so I am not seeing anything like that. The
library these symbols are actually in is not even listed! Here is what I
get.
tycho:~$ldd -r /home/burlen/X/src/lib/libbow.so
linux-gate.so.1 => (0xb7f50000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e40000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e1b000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e0f000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7cc0000)
/lib/ld-linux.so.2 (0xb7f51000)
undefined symbol: _Z10VisItFstatiP6stat64
(/home/burlen/X/src/lib/libbow.so)
undefined symbol: vtk_zlib_inflateInit_ (/home/burlen/X/src/lib/libbow.so)
undefined symbol: vtk_zlib_inflate (/home/burlen/X/src/lib/libbow.so)
undefined symbol: vtk_zlib_inflateEnd (/home/burlen/X/src/lib/libbow.so)
undefined symbol: vtk_zlib_deflateInit_ (/home/burlen/X/src/lib/libbow.so)
undefined symbol: vtk_zlib_deflate (/home/burlen/X/src/lib/libbow.so)
undefined symbol: vtk_zlib_deflateEnd (/home/burlen/X/src/lib/libbow.so)
It works in the original app so I know its just a matter of my not
understanding how the loading process works in this case. I am confused
about how those undefined symbols would get resolved? How can the loader
resolve them with out a path to a specifc .so file? How could the files
be linked successfully with those undefined symbols?
Thanks in advance
Burlen