how to resolve unresolved symbols

Brian Dessent brian@dessent.net
Wed Oct 15 15:51:00 GMT 2008


Burlen Loring wrote:

> How can the loader
> resolve them with out a path to a specifc .so file?

What probably happened was that whatever lib provides those symbols
happened to be already loaded when the application dlopened the plugin,
so the fact that the plugin is missing one or more NEEDED tags didn't
matter.  Maybe the app itself links to that lib, or maybe it was a
plugin that was dlopened prior to libbow.so.  Or perhaps those symbols
are actually defined in the executable.  Whatever sequence of events
cause the symbols to be defined in the real app isn't being replicated
in your standalone app, and that's why it fails.

Using ldd on the plugin doesn't accurately reflect the same
circumstances as when it's dynamically loaded.  With ldd you're asking
the loader to start from scratch whereas with dlopen you have an
established dynamic symbol table reflecting everything that's happened
prior to the call to dlopen.

> How could the files
> be linked successfully with those undefined symbols?

The ELF linker lets you shoot yourself in the foot if you want to.  You
can use -Wl,--no-undefined to change the default.

Brian



More information about the Binutils mailing list