How to pre-relocate shared libraries at a preferred address?

From: Vincent Turcotte (winbloodreg_at_yahoo.ca)
Date: 08/29/03


Date: Fri, 29 Aug 2003 10:16:39 -0400

Hi, we want to be able to load our C++ shared libraries at a preferred
address each time since we have a memory mapped file containing pointers
to functions (persistent object database) that are in shared libraries.
  The memory mapped file sits there (after a mapping of C++ objects) and
we want to load our application at anytime, but we need to be sure that
the shared objects are loaded at the exact same address each time.
Failing that requirement, our memory mapped file calls functions in
unknown address thus crashing big time.

We are able to do this on our Tru64 Unix / Alpha platform with the use
of the so_locations file. How can we do this on Linux? What are the
options we need to pass to the linker?

We are using gcc 3.2.3 for compilation and linking.

Thanks

Vincent Turcotte



Relevant Pages

  • How to pre-relocate shared libraries at a preferred address?
    ... we want to be able to load our C++ shared libraries at a preferred ... address each time since we have a memory mapped file containing pointers ... to functions that are in shared libraries. ...
    (comp.os.linux.development.system)
  • Re: Program doesnt resolve function entry points correctly at runtime
    ... > The problem is that whichever of these shared libraries is loaded ... if I load the shared library that is linked to DB2 first ... > and then load the shared library linked to the Teradata ODBC library, ... > SQLConnect ...
    (comp.unix.aix)
  • Re: Files Stored on NTFS
    ... I can't switch between windows, no music plays, etc. CPU usage is at ... When you load a program, your kernel loads another program to actually ... shared libraries, all programs will have code in them that, for example, ... dynamically linked executables named ".ident", ...
    (alt.os.linux)
  • Re: seLinux: how do I avoid this error
    ... seLinux is enabled, I get the following error from the attempt to load ... "cannot restore segment prot after reloc: ... I have also read in "How to Write Shared Libraries" ... Check that each relocation points to a LOAD ...
    (comp.os.linux.development.apps)
  • how load addresses chosen for shared libs in 64/b OS?
    ... Does someone know how 64 bit linux systems decide where to ... physically load shared libraries, ... second machine). ...
    (comp.os.linux.development.system)