Re: using ld-linux.so to load private libraries



circusfire wrote:
Hello All,

I am not an expert on linux , but have been using it in my profession
for quite some time
and understand things reasonably well. Here I have a problem:

I am writing an application "App" for a platform "Platfrom". "Platfrom"

has a simulator and uses certain "libraries" . However even my app
uses the same libraries. In order to run the "App" from the simulator,
I need to depoly the "App" in specifc directory and write an
application
descriptor for it.

The "libraries" used by "Platform" are in directory
/opt/host/Platfrom/lib
The "libraries" used by my application are in /usr/local/Platfrom/lib

When I launch the simulator and try to run the "App" on it, the App
runs -
but it uses the "libraries" of the "Platform" and not mine. What
happens
is that when I run the "App" on the simulator, loader already finds the

appropriate libs [ in this case Platform's libs ] are already loaded
and
links my app with them.

What I need is , the ability to create a "sand box" environment in
which
my "App" loads my "shared libraries" and execute.
Linking "App" statically is not an option I am looking for.

Now, looking at whatever meager documentation I could lay my
 hands on ld-linux.so, it appears that I can ask the dynamic loader to
load
specifc libraries I would want along with the app.

Any pointers are appreciated.
It isn't clear by your description what you need.
Perhaps all you need is to set the LD_LIBRARY_PATH
environment variable to point to a certain location, so shared
libs will be loaded from that location instead of the default ?
See also the LD_PRELOAD environment variable.
man ld.so provides more information.
.



Relevant Pages

  • Re: Question on creating an executable
    ... My app works fine on W2K but not XP, and I'm pretty sure it has something to ... > define that interface and the GUIDs and ProgIDs that identify it - NEVER ... > support this - all external libraries are dynamically linked in VB. ... > type-checking, call resolution, during compile-time. ...
    (microsoft.public.vb.general.discussion)
  • Re: Run 10.20 App on 11.00 ?
    ... installed on both machines using the vendor's install scripts. ... > if the app links in libc.a then you basically up the creek because you have ... Use chatr to see what the dependent libraries are. ... an industrial control system made by Fisher Control Systems. ...
    (comp.sys.hp.hpux)
  • Re: comparison between portability libraries?
    ... exist quite a few portability libraries for applications on different ... The API for these ... is for the app being written. ...
    (comp.lang.misc)
  • Crashing dlopen() on Sharp Zaurus C860
    ... The code dynamically loads a lot of shared libraries through dlopen ... the first and second load and it fails on the third one. ...
    (comp.os.linux.embedded)
  • Crashing dlopen() on Sharp Zaurus C860
    ... The code dynamically loads a lot of shared libraries through dlopen ... the first and second load and it fails on the third one. ...
    (comp.os.linux.development.system)