Re: dlopen: fatal: relocation error



On Jun 27, 11:57 pm, Frank Cusack <fcus...@xxxxxxxxxxx> wrote:
On Wed, 27 Jun 2007 10:59:54 -0700 shahan...@xxxxxxxxx wrote:



On Jun 27, 9:53 pm, Frank Cusack <fcus...@xxxxxxxxxxx> wrote:
On Wed, 27 Jun 2007 03:36:41 -0700 shahan...@xxxxxxxxx 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

Thanks for the reply..

but it linker in sparc doesn't complain when linking the executable.
Only when its executing dlpoen it gives error. and its clearly says
that it can;t find the reference to the global function in the
executable. Then i check the symbols in the executable with nm and i
can found the missing global function there. im confused with this..

It's not complaining about not finding your global symbol, it's
complaining about the .so not being dlopen()able at all.

...

in the executable im loading the so by using dlopen(...,RTLD_NOW)
in sparc this function fails. dllerror reports could not find
reference to GetLastError

That is not what you reported earlier. You are either confused
about where this error is being generated, or you are not accurately
reporting the errors.

It would probably help to PASTE the output from your compilation and
then running of the program. BTW, did you compile the shared lib with
-fpic? I don't think that's it because you said it works on x86.

-fran

thanks frank
yes i did compile the .so with -fpic. but didn't work..

this is the exact error message dlerror gives after dlopen fails.

ld.so.1: rexserd: fatal: relocation error: file libmsat.d.so: symbol
_Z11GetLastErrorv: referenced symbol not found

where rexserd is my executable which invoke dlopen

as far as i understand this means it can't find the reference to the
GetLastError function isn't it ?

but the GetLastError function (CError* GetLastError (void)) is defined
in the executable and i even checked its symbols using nm -s rexserd |
grep GetLastError .

[475] | 80912| 40|FUNC |GLOB |0 |.text |
_Z11GetLastErrorv

this is the out put.

so what did actually went wrong..





.



Relevant Pages

  • Errors in the OLAP storage engine
    ... I'm working on a plugin clustering algorithm, and trying to train it through a DMX INSERT, but the insert fails with the following message: ... Executing the query ... ... I can train the model successfully from the business studio's GUI, only the DMX seems to fail. ...
    (microsoft.public.sqlserver.datamining)
  • Re: SuSE ghostview configuration
    ... This fails in ghostview, ... Gnome Ghostview and a host of other viewers, ... + I solve this by executing locate and then adding the path to my PATH ... library files will create all sort of misterious failures (like the ...
    (comp.lang.postscript)
  • Re: DirectShow Insanity
    ... its a strange one, but since it only fails in this little test app, it must ... somewhere there is a null pointer... ... > The exception happens immediately upon executing the ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: Go To Column A
    ... I'm trying to write a macro that first inserts a row and then goes to ... column A of that row before executing the rest of its code. ... which successfully inserts the row but fails to go to the column A. ... What is the proper way to do this? ...
    (microsoft.public.excel.programming)
  • Re: thread.Abort()
    ... > as you hang onto the reference. ... > executing code in a finally block - this can be interrupted with unknown ... > target thread is alive but before the next line of code executes a context ... > thread to actually terminate is also unbounded. ...
    (microsoft.public.dotnet.languages.csharp)