mirror of
https://github.com/NixOS/patchelf.git
synced 2025-10-22 07:40:40 +08:00
15ba1450c3e9878e6e9aa8dad28a64f39b51bc6c

useful for the NVIDIA libGL.so, since setting an RPATH on libGL.so to include its dependencies (like libXext and libGLcore) makes it unnecessary to set an RPATH on the executables that use it. This is especially important for executables that use RUNPATH (like Wine) since there the paths in RUNPATH are ignored when resolving the dependencies of dependencies (i.e. RUNPATH is scoped).
PatchELF is simple utility for modifing existing ELF executables and libraries. In particular, it can do the following: * Change the dynamic loader ("ELF interpreter") of executables: $ patchelf --set-interpreter /lib/my-ld-linux.so.2 my-program * Change the RPATH of executables and libraries: $ patchelf --set-rpath /opt/my-libs/lib:/other-libs my-program * Shrink the RPATH of executables and libraries: $ patchelf --shrink-rpath my-program This removes from the RPATH all directories that do not contain a library referenced by DT_NEEDED fields of the executable or library. For instance, if an executable references one library libfoo.so, has an RPATH "/lib:/usr/lib:/foo/lib", and libfoo.so can only be found in /foo/lib, then the new RPATH will be "/foo/lib". AUTHOR Copyright 2004, 2005, 2006, 2007, 2008 Eelco Dolstra <eelco@cs.uu.nl>. See COPYING for the license. HOMEPAGE http://nixos.org/patchelf.html BUGS Currently setting the RPATH on libraries ("--set-rpath") will usually fail if the new RPATH is longer then the old RPATH. The `strip' command from binutils generated broken executables when applied to the output of patchelf (if `--set-rpath' or `--set-interpreter' with a larger path than the original is used). This appears to be a bug in binutils (http://bugs.strategoxt.org/browse/NIXPKGS-85). RELEASE HISTORY 0.4 (TBA): * IA-64 support (not tested) and related 64-bit fixes. * FreeBSD support. * `--set-rpath', `--shrink-rpath' and `--print-rpath' now prefer DT_RUNPATH over DT_RPATH, which is obsolete. When updating, if both are present, both are updated. If only DT_RPATH is present, it is converted to DT_RUNPATH unless `--force-rpath' is specified. If neither is present, a DT_RUNPATH is added unless `--force-rpath' is specified, in which case a DT_RPATH is added. 0.3 (May 24, 2007): * Support for 64-bit ELF binaries (such as on x86_64-linux). * Support for big-endian ELF binaries (such as on powerpc-linux). * Various bugfixes. 0.2 (January 15, 2007): * Provides a hack to get certain programs (such as the Belastingaangifte 2005) to work. 0.1 (October 11, 2005): * Initial release.
Description
Languages
C
48.4%
C++
27.5%
Shell
11%
M4
5.7%
Nix
3.4%
Other
4%