指定编译和运行期间的库搜索路径RPATH和RUNPATH,这两个路径同样会写入到二进制文件中,但只有RUNPATH起作用,RPATH会被忽略掉。RUNPATH实际是RPATH的另一个版本,区别是RPATH不能被LD_LIBRARY_PATH覆盖,而RUNPATH则可以被LD_LIBRARY_PATH覆盖。
1. the RPATH binary header (set at build-time) of the library causing the lookup (if any)
2. the RPATH binary header (set at build-time) of the executable
3. the LD_LIBRARY_PATH environment variable (set at run-time)
4. the RUNPATH binary header (set at build-time) of the executable
5. /etc/ld.so.cache
6. base library directories (/lib and /usr/lib)