patchelf:一个在 Linux 上用于“修改(patch)ELF 可执行文件或共享库”的命令行工具,常见用途包括更改动态链接器(interpreter)、调整 RPATH/RUNPATH、替换依赖库名称等(主要用于部署与打包场景)。
/ˈpætʃˌɛlf/
I used patchelf to set the RPATH of the binary.
我用 patchelf 来设置这个二进制文件的 RPATH。
After moving the app to a new folder, we ran patchelf to change the dynamic linker path so it could find the correct shared libraries at runtime.
把应用移动到新目录后,我们运行 patchelf 修改动态链接器路径,这样它在运行时就能找到正确的共享库。
由 patch(修补、打补丁)+ ELF(Executable and Linkable Format,Linux/Unix 常见的可执行文件格式)组合而来;字面意思就是“给 ELF 文件打补丁/做修改”。