When you send a binary file, it would be nice to give users the opportunity to adapt the binary file to the specifics of their own system, including by setting up search paths in the library.
The user can usually configure LD_LIBRARY_PATH and /etc/ld.so.conf , both of which have lower priority than DT_RPATH , that is, you cannot override what is hardcoded in binary /etc/ld.so.conf , whereas if you use DT_RUNPATH instead, the user can override this with LD_LIBRARY_PATH .
(FWIW, I think ld.so.conf should also take precedence over DT_RUNPATH , but in any case, at least we have LD_LIBRARY_PATH ).
In addition, I strongly disagree with the proposal above to use DT_RPATH . IMO, it is best to use DT_RPATH not in DT_RUNPATH in the supplied binaries.
if
you supply all dependent libraries with your executables and want to make sure that JustWork (tm) after installation, in this case uses DT_RPATH .
chill Nov 06 2018-11-11T13
source share