This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld and rpath in .so
- From: Andrew Bell <andrew dot bell dot ia at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Wed, 23 Jan 2019 17:38:54 -0500
- Subject: ld and rpath in .so
Hi,
My understanding is that ld will use the RPATH in a shared object to locate
secondary shared objects when linking an executable.
I'm trying to build a conda package and this doesn't seem to be happening.
I can use readelf to verify that the RPATH is set in the linked library to
point to the directory containing the secondary libraries, but when I link
my executable with the linked library, I get an error saying that the
secondary libraries can't be found. Using -rpath-link on the command line
to explicitly specify the path that's embedded in the linked library rpath
resolves the issue (though -rpath on the command line fails). I'm using
ld through g++ 7.3.
Is there some circumstance that would cause ld to ignore the rpath embedded
in a linked library when attempting to locate a NEEDED item? Am I
misunderstanding something in the way ld locates secondary libraries?
Thanks,
--
Andrew Bell
andrew.bell.ia@gmail.com