Red Hat Bugzilla – Bug 20218
LD_RUN_PATH vs. LD_LIBRARY_PATH
Last modified: 2007-04-18 12:29:38 EDT
The man page of ld states that it uses the LD_RUN_PATH variable to look for
libraries that are linked with a given binary. However, in fact, the
LD_LIBRARY_PATH variable is used. This is confusing.
I could not find any man page which mentioned LD_LIBRARY_PATH.
LD_RUN_PATH variable is used by the linker (ld) the same way as -rpath
argument to ld is used (LD_RUN_PATH is used if -rpath is not specified).
However, if some binary is linked without LD_RUN_PATH being set in environment
(resp. -rpath specified on ld command line) and you want to change the paths
used to look for libraries at runtime, you use the LD_LIBRARY_PATH variable
which is used by the dynamic linker (/lib/ld-linux.so.*).