rpath 参数是指定库运行时首先加载系统依赖库的路径,如果找不到依赖库将到系统默认的路径库查找
chrpath --help
Usage: chrpath [-v|-d|-c|-r ] [ ...]
-v|--version Display program version number
-d|--delete Delete current rpath/runpath setting
-c|--convert Convert rpath to runpath
-r |--replace Replace current rpath/runpath setting
with the path given
-l|--list List the current rpath/runpath (default)
-h|--help Show this usage information.
chrpath -l /lib/xxx.so 显示rpath路径
chrpath -r /lib64 /lib/xxx.so 修改rpath路径
patchelf --help
syntax: patchelf
[--set-interpreter FILENAME]
[--page-size SIZE]
[--print-interpreter]
[--print-soname] Prints 'DT_SONAME' entry of .dynamic section. Raises an error if DT_SONAME doesn't exist
[--set-soname SONAME] Sets 'DT_SONAME' entry to SONAME.
[--set-rpath RPATH]
[--remove-rpath]
[--shrink-rpath]
[--print-rpath]
[--force-rpath]
[--add-needed LIBRARY]
[--remove-needed LIBRARY]
[--replace-needed LIBRARY NEW_LIBRARY]
[--print-needed]
[--no-default-lib]
[--debug]
[--version]
FILENAME
patchelf --set-rpath /lib64 /lib/xxx.so