views:

50

answers:

4

I ran truss command on executable and get the below output:

stat64("/net/xyzmachine/vol/tools/solx64/studio11/SUNWspro/lib/rw7/librt.so.1", 0x080474A0) (sleeping...) stat64("/net/xyzmachine/vol/tools/solx64/studio11/SUNWspro/lib/rw7/librt.so.1", 0x080474A0) Err#2 ENOENT stat64("/net/xyzmachine/vol/tools/solx64/studio11/SUNWspro/lib/librt.so.1", 0x080474A0) (sleeping...)

I went through the build logs and Envs of buildhost but the LD_LIB_PATH, LIBPATH, LD_RUN_PATH value is not pointing to this location. I am not able to get that from where this value came?

Can any one help me in understanding this? how the lib search path decided? How to troubleshoot the same?

A: 

Perhaps this library is dependency of some of your application's dependencies. ldd prints recursively all shared libraries, that your application or its dependency depend on.

It searches the libraries in paths described in /etc/ld.so.conf (/etc/ld.so.conf.d/) or LD_LIBRARY_PATH.

Note that also rpath could be set in the shared library itself.

More info here: Program-Library-HOWTO

Dmitry Yudakov
Thanks for the answer. but I am not getting such file in the system where i built it. Adding more information, the system is Solaris x86.
Dan
try `ldd -v`, perhaps you'll get more info about where it comes from
Dmitry Yudakov
A: 

The linker used to create the executable has probably hardcoded some path directly in the executable. Most linkers do that by default and allow to specify options on the command line to add specific additional paths to look at for .so libraries.

Benoit Thiery
A: 

Looks like you might have your rpath set in the executable. Try:

chrpath /path/to/binary

And see if that prints anything like the paths you're getting from ldd. To remove your rpath and use standard system libraries use:

chrpath -d /path/to/executable
Burton Samograd
Thanks for the help. I tried this solution but output was "Length of dynamic section is zero.found no dynamic section: Error 0"
Dan
A: 

Thank you guys for your help. I found the issue. some one has removed /opt/studio11 directory and make a link to /net/xyzmachine/vol/tools/solx64/studio11. so during compilation it is showing me as /opt/studio11/.... but in map file it is keeping "net/xyzmachine/vol/tools/solx64/studio11" value.

Thanks once again for your help.

Dan