Re: dlopen: fatal: relocation error



On Wed, 27 Jun 2007 10:59:54 -0700 shahan.am@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
.



Relevant Pages

  • Re: dlopen: fatal: relocation error
    ... dlopen function in the executable fails. ... Try linking with -z defs (sorry don't know the gcc equiv) and the ... but it linker in sparc doesn't complain when linking the executable. ... Only when its executing dlpoen it gives error. ...
    (comp.unix.programmer)
  • Re: JEVE-W-BADISD, illegal image section descriptor
    ... I am executing a source imagein which there are some calls ... Did You transfer the executable or shareable image through some network ... means in wrong mode (ascii, not binary ?), so it really is corrupted. ... Did You ignore warnings when linking the executable, ...
    (comp.os.vms)
  • Re: Headers/footers not working in Mailmerge
    ... executing the merge. ... If you are using Word XP or later, the "Add-in to Merge Letters to Separate ... allow you to create each letter as a separate file with a filename taken ... I am creating reports in mailmerge. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Confused about ListUserColumnPermissions
    ... > of obtaining column level permissions would include querying ... > the view information_schema.column_privileges and executing ... > the stored procedure sp_column_privileges. ... sp_column_privileges reports the Grantee as the user, ...
    (microsoft.public.sqlserver.security)