Question about finding depending libs

Raimar Falke mM3{3S0JV5YQkbx-4JOVT@rf.risimo.net
Thu Jan 17 12:03:00 GMT 2008


Hello

I have a question regarding the behaviour of RPATH/RUNPATH. Suppose
you have an application which needs a lib (libbar) and this lib needs
another lib (libfoo). Suppose further that the application contains an
RPATH/RUNPATH entry and the "middle" lib doesn't. See also the
attached tar file.

Now the question is will the RPATH/RUNPATH of the application be used
for finding libfoo?

Another question is that in the attached example the entries generated
in the application differ:

 GNU ld version 2.17 Debian GNU/Linux on 32bit and GNU ld (GNU
 Binutils for Ubuntu) 2.18 on 64bit produces only an RPATH
 entry.

 GNU ld version 2.16.91.0.5 20051219 (SUSE Linux) on 32bit and GNU ld
 version 2.17.50.0.5 20060927 (SUSE Linux) on 64bit produces both
 RPATH and RUNPATH entry.

Am I correct that this difference was caused by passing
"--enable-new-dtags" to ld at configure time?

According to http://people.redhat.com/drepper/dsohowto.pdf the
difference between these two should only matter if LD_LIBRARY_PATH is
set. However it turns out that the binaries which contain both entries
(PATH and RUNPATH) fail to run with 

./app: error while loading shared libraries: libfoo.so.1: cannot open shared object file: No such file or directory

It looks to me that if only RPATH is set this RPATH is used to search
also for "indirect" libs (like libfoo in the example). Is this the
case? Is this documented somewhere?

	Raimar

-- 
 email: mM3{3S0JV5YQkbx-4JOVT@rf.risimo.net
 "SIGDANGER - The System is likely to crash soon"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ld_test.tar
Type: application/x-tar
Size: 10240 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20080117/1ec2e31d/attachment.tar>


More information about the Binutils mailing list