For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > June 2007 > Re: dlopen: fatal: relocation error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: dlopen: fatal: relocation error
guenther@gmail.com

2007-06-27, 10:05 pm

On Jun 27, 4:36 am, shahan...@gmail.com wrote:
....
> 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


Hmm, I don't see a -rdynamic option in the info pages for ld version
2.15.92.0.2. How do the info pages on your system describe that
option?


> * 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


Ugh, you're using GNU ld. Unless you have a particular reason to use
the GNU linker, I would suggest using Sun's linker (/usr/ccs/bin/ld)
under Solaris.


> ld.so.1: rexserd: fatal: relocation error: file libmsat.d.so: symbol

_Z11GetLastErrorv: referenced symbol not found
>
> what went wrong with SPARC ? how do i get this work ?


In no particular order:
1) are you dang sure it's opening the copy of the shared object that
you think it is?
2) what is the *exact* call to dlopen() that you're making?
3) are there other shared objects being loaded? Do any them in
turn load libmsat.d.so, perhaps with different flags?


Philip Guenther

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com