Hello,
I am testing shared libraries (.so). I made a sample library and sample test program, using dlopen, dlsym, and so on.
Shared libraries are memory mapped starting at 0xEF000000.
As far as I found debugging my code, it appears the sample library is correctly loaded @ 0xEFxxxxxxxx.
Using dlsym on functions works ok.
But, it looks like pointers stored in structures are not relocated correctly. In fact, all is missing is the 0xEFxxxxxx upper bits.
For example, If I use dlsym to get a structure with pointers (strings, functions, whatever), the
structure pointers are missing 0xEF in the upper bits.
Example : 0x006d0828 instead of
0xfe006d0828.
I am using gcc version 2.95.2.
The shared library is loaded using RTLD_NOW | RTLD_GLOBAL flags.
Any idea where I could be wrong ? I suspect gcc, but, being not an expert on solaris programming,
I prefer asking first.
thank you for your help !
Looks like I am not the first one...
Quote:Shared library problems on Solaris
From:
david . henderson
Subject:
Shared library problems on Solaris
Date:
Tue, 20 Mar 2001 12:01:36 +0000
I've just updated my compiler to GCC 2.95.3 on Solaris 2.5.1 ( sparc) and i'm
having problems with some C++ shared libraries.
I'm finding that any data initialized in the shared library is not correct (
it's null) when application programs come to us it. I'd rather not use static
versions of these libraries if it can be helped.
These shared libraries work ok when compiled with V4 of the Sun C++ compiler or
GCC 2.91.x on a Linux system.
Am i missing some compiler/linker options or is there a fault in this version of
the compiler. ( All 2.95.x version of GCC have given the same problem).
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be
privileged. If you are not a named recipient, please notify the sender
immediately and do not disclose the contents to another person, use it for any
purpose or store or copy the information in any medium.