This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: how to resolve unresolved symbols


Brian Dessent wrote:
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
Great explanation, very helpful, Thanks,
Burlen


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