Subject: ELF confusion: shlib embedded rpath precedes executable RPATH or user LD_LIBRARY_PATH?
To: None <current-users@netbsd.org>
From: John Kohl <jtk@kolvir.arlington.ma.us>
List: current-users
Date: 07/21/1999 10:01:38
I'm working on fixing some encryption problems I have in the latest
telnet.  In the midst of this, I ran into unexpected ELF shared library
linking behavior.  Can someone tell me if the following behavior is
expected, and if so, why?

* libtelnet.so.2, libkrb.so.3, libdes.so.4 are all installed in
/usr/dest/usr/lib.  Older versions of libkrb.so.3 and libdes.so.4 are in
/usr/lib.

* libtelnet.so.2 is built with an embedded RPATH /usr/lib, depending on
libkrb.so.3 and libdes.so.4.

* I build a debugging telnet with an embedded RPATH of
/usr/dest/usr/lib.  It depends on libtelnet.so.2, libkrb.so.3, and libdes.so.4

* without LD_LIBRARY_PATH set, ldd on said telnet shows two sets of krb
& des libraries, one each from /usr/lib and /usr/dest/usr/lib !

* with LD_LIBRARY_PATH=/usr/dest/usr/lib, ldd on said telnet *still* two
sets of krb & des libraries, one each from /usr/lib and
/usr/dest/usr/lib !

1. Shouldn't LD_LIBRARY_PATH precede any embedded RPATH inside .so's
activated by running a program?  If not, why not?

2. Should a program's embedded RPATH override/precede the RPATH in an
object it links to?  (telnet to libtelnet.so.2 in this case)

-- 
==John Kohl <jtk@kolvir.arlington.ma.us>, <john_kohl@alum.mit.edu>
Write a poem, share your heart!
Home page: <http://people.ne.mediaone.net/jtk/>
Note new home zip code as of July 1, 1998: 02476