开发者

ldd command searching libs at some arbitrary location

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?


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


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜