linux 修改 elf 文件的dynamic linker 和 rpath

linux 修改 elf 文件的dynamic linker 和 rpath

https://nixos.org/patchelf.html

下载地址

https://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.gz

https://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2

$ ./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

================= End

原文地址:https://www.cnblogs.com/lsgxeva/p/9645928.html