Technology-修改 SO 文件依赖库

修改 SO 文件依赖库

依赖库修改

1
2
3
4
5
patchelf --replace-needed liboriginal.so.1 libreplacement.so.1 my-program
patchelf --set-soname libreplacement.so.1 liboriginal.so.1

readelf -d XX.so
ldd -l XX.so

问题及解决

问题:

1
Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!

解决:

1
用 patchelf 1.0以上,不要用0.9