Article 6D4EM ldd falsely generates "not found" for valid library

ldd falsely generates "not found" for valid library

by
selfprogrammed
from LinuxQuestions.org on (#6D4EM)
I have been writing a dependency checker for slackware binaries.
It works, but is generating false detects because ldd is falsely outputting "not found".

The libraries that are not found all are shipped with the binary in their own lib directory. When one of the libraries in the dedicated lib directory references another in that same directory, ldd does not detect it.

It seems that ldd only find libraries that are in one of the common library directories.

Question: It has been said that shipping your binary with needed libraries in the same directory with the executable is supposed to work. Those libraries are supposed to be found first.

All my reading of dynamic linking order and reading ld man page cannot prove that.

I have packages that are seem to be doing exactly that, and they work.
They are the ones that ldd is falsely, not found.

I have checked by running the program and using lsof and fuser to see that the libraries that supposedly were "not found" were actually opened and were in use.

I am curious if others could report of the same behavior of ldd on their systems.
Is this systematic of ldd, or do I have some bad setup.
Please give evidence of your testing, not wild guessing.

Firefox
/usr/lib/firefox/libmozavcodec.so
- libmozavutil.so not found
(it is actually right there in the same directory)

seamonky
/usr/lib/seamonkey/libmozavcode.so
- libmozavutil.so not found
/usr/lib/seamonkey/libxul.so
- libldap60.so not found
- libprldap60.so not found
- libmozgtk.so not found
- liblgpllibs.so not found
- libmozsandbox.so not found
- libmozsqlite.so not found

wine
/usr/lib/wine/i386-unix/libxul.so
(same missing as in seamonkey)
/usr/lib/wine/i386-unix/bcrypt.so (and many others)
ntdll.so not found

quicktime
/usr/lib/libquicktime/lqt_x264.so
libx264.so.148 not found
(This one may be real, as I have /usr/lib/libx264.163)
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments