This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]