Changing hard-code dynamic libraries
Hi,
Apologies if this is in the wrong forum, it is a difficult topic to place.
I have compiled an executable using a networked version of purify and the sun C++ compiler. When I run ldd to see which dynamic libraries the executable is attempting to link, I see the following:
ldd a.exe.pure
/net/appServer/usr/app/rational/releases/purify.sol.2003a.06.15.FixPack.0194/li b32/libpure_solaris2_init.so
This is a hard-coded library path. Curiously, when I compile another executable using a local-server version of purify against a dummy program, I get the following from running ldd:
ldd a.out
libpure_solaris2_init.so.1 =>/opt/rational/releases/purify.sol.2003a.06.13.FixPack.0168/lib32/libpure_solari s2_init.so.1
The difference here is that "a.out" has a soft-link to a library rather than a hard-wired path. LD_LIBRARY_PATH plays no part in resolving libpure_solaris2_init.so.1 for the hard-wired version and fails to resolve at execution time.
What I am wondering is whether it is possible to change the library pointed to in the executable AFTER the executable has been compiled. In this way, I would be able to "re-instruct" the a.exe.pure to use a local libpure_solaris2_init.so.1 rather than the networked library.
As a first thought, I had a look at the 'ld - link editor' but couldnt seem to find anything that would achieve this.
If anyone have any ideas they would be most welcome.
rgds,
J

