blob: 3759cb458aaa85a69e59460d346cf3e1e38fa01e [file] [log] [blame]
<html lang="en">
<head>
<title>elfedit - GNU Binary Utilities</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Binary Utilities">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="readelf.html#readelf" title="readelf">
<link rel="next" href="Common-Options.html#Common-Options" title="Common Options">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1991-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="elfedit"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Common-Options.html#Common-Options">Common Options</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="readelf.html#readelf">readelf</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">15 elfedit</h2>
<p><a name="index-Update-ELF-header-170"></a><a name="index-elfedit-171"></a>
<!-- man title elfedit update ELF header and program property of ELF files -->
<pre class="smallexample"> <!-- man begin SYNOPSIS elfedit -->
elfedit [<samp><span class="option">--input-mach=</span></samp><var>machine</var>]
[<samp><span class="option">--input-type=</span></samp><var>type</var>]
[<samp><span class="option">--input-osabi=</span></samp><var>osabi</var>]
<samp><span class="option">--output-mach=</span></samp><var>machine</var>
<samp><span class="option">--output-type=</span></samp><var>type</var>
<samp><span class="option">--output-osabi=</span></samp><var>osabi</var>
<samp><span class="option">--enable-x86-feature=</span></samp><var>feature</var>
<samp><span class="option">--disable-x86-feature=</span></samp><var>feature</var>
[<samp><span class="option">-v</span></samp>|<samp><span class="option">--version</span></samp>]
[<samp><span class="option">-h</span></samp>|<samp><span class="option">--help</span></samp>]
<var>elffile</var>...
<!-- man end -->
</pre>
<!-- man begin DESCRIPTION elfedit -->
<p><samp><span class="command">elfedit</span></samp> updates the ELF header and program property of ELF
files which have the matching ELF machine and file types. The options
control how and which fields in the ELF header and program property
should be updated.
<p><var>elffile</var><small class="dots">...</small> are the ELF files to be updated. 32-bit and
64-bit ELF files are supported, as are archives containing ELF files.
<!-- man end -->
<!-- man begin OPTIONS elfedit -->
<p>The long and short forms of options, shown here as alternatives, are
equivalent. At least one of the <samp><span class="option">--output-mach</span></samp>,
<samp><span class="option">--output-type</span></samp>, <samp><span class="option">--output-osabi</span></samp>,
<samp><span class="option">--enable-x86-feature</span></samp> and <samp><span class="option">--disable-x86-feature</span></samp>
options must be given.
<dl>
<dt><samp><span class="env">--input-mach=</span><var>machine</var></samp><dd>Set the matching input ELF machine type to <var>machine</var>. If
<samp><span class="option">--input-mach</span></samp> isn't specified, it will match any ELF
machine types.
<p>The supported ELF machine types are, <var>i386</var>, <var>IAMCU</var>, <var>L1OM</var>,
<var>K1OM</var> and <var>x86-64</var>.
<br><dt><samp><span class="env">--output-mach=</span><var>machine</var></samp><dd>Change the ELF machine type in the ELF header to <var>machine</var>. The
supported ELF machine types are the same as <samp><span class="option">--input-mach</span></samp>.
<br><dt><samp><span class="env">--input-type=</span><var>type</var></samp><dd>Set the matching input ELF file type to <var>type</var>. If
<samp><span class="option">--input-type</span></samp> isn't specified, it will match any ELF file types.
<p>The supported ELF file types are, <var>rel</var>, <var>exec</var> and <var>dyn</var>.
<br><dt><samp><span class="env">--output-type=</span><var>type</var></samp><dd>Change the ELF file type in the ELF header to <var>type</var>. The
supported ELF types are the same as <samp><span class="option">--input-type</span></samp>.
<br><dt><samp><span class="env">--input-osabi=</span><var>osabi</var></samp><dd>Set the matching input ELF file OSABI to <var>osabi</var>. If
<samp><span class="option">--input-osabi</span></samp> isn't specified, it will match any ELF OSABIs.
<p>The supported ELF OSABIs are, <var>none</var>, <var>HPUX</var>, <var>NetBSD</var>,
<var>GNU</var>, <var>Linux</var> (alias for <var>GNU</var>),
<var>Solaris</var>, <var>AIX</var>, <var>Irix</var>,
<var>FreeBSD</var>, <var>TRU64</var>, <var>Modesto</var>, <var>OpenBSD</var>, <var>OpenVMS</var>,
<var>NSK</var>, <var>AROS</var> and <var>FenixOS</var>.
<br><dt><samp><span class="env">--output-osabi=</span><var>osabi</var></samp><dd>Change the ELF OSABI in the ELF header to <var>osabi</var>. The
supported ELF OSABI are the same as <samp><span class="option">--input-osabi</span></samp>.
<br><dt><samp><span class="env">--enable-x86-feature=</span><var>feature</var></samp><dd>Set the <var>feature</var> bit in program property in <var>exec</var> or <var>dyn</var>
ELF files with machine types of <var>i386</var> or <var>x86-64</var>. The
supported features are, <var>ibt</var> and <var>shstk</var>.
<br><dt><samp><span class="env">--disable-x86-feature=</span><var>feature</var></samp><dd>Clear the <var>feature</var> bit in program property in <var>exec</var> or
<var>dyn</var> ELF files with machine types of <var>i386</var> or <var>x86-64</var>.
The supported features are the same as <samp><span class="option">--enable-x86-feature</span></samp>.
<p>Note: <samp><span class="option">--enable-x86-feature</span></samp> and <samp><span class="option">--disable-x86-feature</span></samp>
are available only on hosts with &lsquo;<samp><span class="samp">mmap</span></samp>&rsquo; support.
<br><dt><samp><span class="env">-v</span></samp><dt><samp><span class="env">--version</span></samp><dd>Display the version number of <samp><span class="command">elfedit</span></samp>.
<br><dt><samp><span class="env">-h</span></samp><dt><samp><span class="env">--help</span></samp><dd>Display the command-line options understood by <samp><span class="command">elfedit</span></samp>.
</dl>
<!-- man end -->
</body></html>