linux 设置库路径,动态修改linux库的rpath路径

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值