1PATCHELF(1) User Manuals PATCHELF(1)
2
3
4
6 patchelf - Modify ELF files
7
8
10 patchelf OPTION FILE
11
12
14 PatchELF is a simple utility for modifying existing ELF executables and
15 libraries. It can change the dynamic loader ("ELF interpreter") of
16 executables and change the RPATH of executables and libraries.
17
18
20 The single option given operates on a given FILE, editing in place.
21
22
23 --page-size SIZE
24 Uses the given page size instead of the default.
25
26
27 --set-interpreter INTERPRETER
28 Change the dynamic loader ("ELF interpreter") of executable
29 given to INTERPRETER.
30
31
32 --print-interpreter
33 Prints the ELF interpreter of the executable.
34
35
36 --print-soname
37 Prints DT_SONAME entry of .dynamic section. Raises an error if
38 DT_SONAME doesn't exist.
39
40
41 --set-soname SONAME
42 Sets DT_SONAME entry of a library to SONAME.
43
44
45 --set-rpath RPATH
46 Change the RPATH of the executable or library to RPATH.
47
48
49 --remove-rpath
50 Removes the DT_RPATH or DT_RUNPATH entry of the executable or
51 library.
52
53
54 --shrink-rpath
55 Remove from the RPATH all directories that do not contain a
56 library referenced by DT_NEEDED fields of the executable or
57 library.
58
59 For instance, if an executable references one library libfoo.so,
60 has an RPATH "/lib:/usr/lib:/foo/lib", and libfoo.so can only be
61 found in /foo/lib, then the new RPATH will be "/foo/lib".
62
63
64 --print-rpath
65 Prints the RPATH for an executable or library.
66
67
68 --force-rpath
69 Forces the use of the obsolete DT_RPATH in the file instead of
70 DT_RUNPATH. By default DT_RPATH is converted to DT_RUNPATH.
71
72
73 --add-needed LIBRARY
74 Adds a declared dependency on a dynamic library (DT_NEEDED).
75 This option can be give multiple times.
76
77
78 --replace-needed LIB_ORIG LIB_NEW
79 Replaces a declared dependency on a dynamic library with another
80 one (DT_NEEDED). This option can be give multiple times.
81
82
83 --remove-needed LIBRARY
84 Removes a declared depency on LIBRARY (DT_NEEDED entry). This
85 option can be given multiple times.
86
87
88 --no-default-lib
89 Marks the object that the search for dependencies of this object
90 will ignore any default library search paths.
91
92
93 --debug
94 Prints details of the changes made to the input file.
95
96
97 --version
98 Shows the version of patchelf.
99
100
102 Eelco Dolstra <e.dolstra@tudelft.nl>
103
104
106 elf(5), ld.so(8)
107
108
109
110
111
112PATCHELF JUNE 2010 PATCHELF(1)