• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..11-Nov-2020-

COPYINGH A D11-Nov-202034.3 KiB675553

READMEH A D11-Nov-20203 KiB10863

elf.hH A D11-Nov-2020109.7 KiB2,6751,987

patchelf.ccH A D11-Nov-202039.3 KiB1,240831

README

1PatchELF is a simple utility for modifing existing ELF executables and
2libraries.  In particular, it can do the following:
3
4* Change the dynamic loader ("ELF interpreter") of executables:
5
6  $ patchelf --set-interpreter /lib/my-ld-linux.so.2 my-program
7
8* Change the RPATH of executables and libraries:
9
10  $ patchelf --set-rpath /opt/my-libs/lib:/other-libs my-program
11
12* Shrink the RPATH of executables and libraries:
13
14  $ patchelf --shrink-rpath my-program
15
16  This removes from the RPATH all directories that do not contain a
17  library referenced by DT_NEEDED fields of the executable or library.
18  For instance, if an executable references one library libfoo.so, has
19  an RPATH "/lib:/usr/lib:/foo/lib", and libfoo.so can only be found
20  in /foo/lib, then the new RPATH will be "/foo/lib".
21
22
23AUTHOR
24
25Copyright 2004-2009 Eelco Dolstra <e.dolstra@tudelft.nl>.
26
27
28LICENSE
29
30This program is free software: you can redistribute it and/or modify
31it under the terms of the GNU General Public License as published by
32the Free Software Foundation, either version 3 of the License, or (at
33your option) any later version.
34
35This program is distributed in the hope that it will be useful, but
36WITHOUT ANY WARRANTY; without even the implied warranty of
37MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
38General Public License for more details.
39
40You should have received a copy of the GNU General Public License
41along with this program.  If not, see <http://www.gnu.org/licenses/>.
42
43
44HOMEPAGE
45
46http://nixos.org/patchelf.html
47
48
49BUGS
50
51The `strip' command from binutils generated broken executables when
52applied to the output of patchelf (if `--set-rpath' or
53`--set-interpreter' with a larger path than the original is used).
54This appears to be a bug in binutils
55(http://bugs.strategoxt.org/browse/NIXPKGS-85).
56
57
58RELEASE HISTORY
59
600.6 (November 7, 2011):
61
62* Hacky support for executables created by the Gold linker.
63
64* Support segments with an alignment of 0 (contributed by Zack
65  Weinberg).
66
67* Added a manual page (contributed by Jeremy Sanders
68  <jeremy@jeremysanders.net>).
69
700.5 (November 4, 2009):
71
72* Various bugfixes.
73
74* `--force-rpath' now deletes the DT_RUNPATH if it is present.
75
760.4 (June 4, 2008):
77
78* Support for growing the RPATH on dynamic libraries.
79
80* IA-64 support (not tested) and related 64-bit fixes.
81
82* FreeBSD support.
83
84* `--set-rpath', `--shrink-rpath' and `--print-rpath' now prefer
85  DT_RUNPATH over DT_RPATH, which is obsolete.  When updating, if both
86  are present, both are updated.  If only DT_RPATH is present, it is
87  converted to DT_RUNPATH unless `--force-rpath' is specified.  If
88  neither is present, a DT_RUNPATH is added unless `--force-rpath' is
89  specified, in which case a DT_RPATH is added.
90
910.3 (May 24, 2007):
92
93* Support for 64-bit ELF binaries (such as on x86_64-linux).
94
95* Support for big-endian ELF binaries (such as on powerpc-linux).
96
97* Various bugfixes.
98
990.2 (January 15, 2007):
100
101* Provides a hack to get certain programs (such as the
102  Belastingaangifte 2005) to work.
103
1040.1 (October 11, 2005):
105
106* Initial release.
107
108