| Author |
dlopen: fatal: relocation error
|
|
| shahan.am@gmail.com 2007-06-27, 8:06 am |
| Hi all..
Im facing a trouble in using dlopen. The scenario is as this.
i have a executable with a global function. when executing this its
dynamically linking with some .so s. (by using dlopen) . In those .so
s im using that global function by giving extern.
* I gave -rdynamic to ld when linking the executable in linux and it
works fine
* in solaris x86 (5.10) it works ok without any additional flags
* but in solaris SPARC (5.9) even though i linked with --export-
dynamic flag, dlopen function in the executable fails. i check the
error with dlerror it says
fatal: relocation error: : referenced symbol not found
what went wrong with SPARC ? how do i get this work ?
Your help in this highly appreciated...
Thanks..
~sh
| |
| Frank Cusack 2007-06-27, 7:08 pm |
| On Wed, 27 Jun 2007 03:36:41 -0700 shahan.am@gmail.com wrote:
> * but in solaris SPARC (5.9) even though i linked with --export-
> dynamic flag, dlopen function in the executable fails. i check the
> error with dlerror it says
>
> fatal: relocation error: : referenced symbol not found
>
> what went wrong with SPARC ? how do i get this work ?
Try linking with -z defs (sorry don't know the gcc equiv) and the
linker will tell you what it can't find. Or link the executable
directly against the shared lib (just to get more detail on the
error). I would guess it's a libgcc_s symbol. libgcc/libgcc_s
differs between platforms. Or try adding -lgcc_s to the shared lib
link command and then see if it works.
-frank
| |
|
|
|
|