1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<!-- Copyright (C) 1991-2021 Free Software Foundation, Inc. 4 5Permission is granted to copy, distribute and/or modify this document 6under the terms of the GNU Free Documentation License, Version 1.3 7or any later version published by the Free Software Foundation; 8with no Invariant Sections, with no Front-Cover Texts, and with no 9Back-Cover Texts. A copy of the license is included in the 10section entitled "GNU Free Documentation License". 11 --> 12<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ --> 13<head> 14<title>GNU Binary Utilities: elfedit</title> 15 16<meta name="description" content="GNU Binary Utilities: elfedit"> 17<meta name="keywords" content="GNU Binary Utilities: elfedit"> 18<meta name="resource-type" content="document"> 19<meta name="distribution" content="global"> 20<meta name="Generator" content="makeinfo"> 21<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 22<link href="index.html#Top" rel="start" title="Top"> 23<link href="Binutils-Index.html#Binutils-Index" rel="index" title="Binutils Index"> 24<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> 25<link href="index.html#Top" rel="up" title="Top"> 26<link href="Common-Options.html#Common-Options" rel="next" title="Common Options"> 27<link href="readelf.html#readelf" rel="previous" title="readelf"> 28<style type="text/css"> 29<!-- 30a.summary-letter {text-decoration: none} 31blockquote.smallquotation {font-size: smaller} 32div.display {margin-left: 3.2em} 33div.example {margin-left: 3.2em} 34div.indentedblock {margin-left: 3.2em} 35div.lisp {margin-left: 3.2em} 36div.smalldisplay {margin-left: 3.2em} 37div.smallexample {margin-left: 3.2em} 38div.smallindentedblock {margin-left: 3.2em; font-size: smaller} 39div.smalllisp {margin-left: 3.2em} 40kbd {font-style:oblique} 41pre.display {font-family: inherit} 42pre.format {font-family: inherit} 43pre.menu-comment {font-family: serif} 44pre.menu-preformatted {font-family: serif} 45pre.smalldisplay {font-family: inherit; font-size: smaller} 46pre.smallexample {font-size: smaller} 47pre.smallformat {font-family: inherit; font-size: smaller} 48pre.smalllisp {font-size: smaller} 49span.nocodebreak {white-space:nowrap} 50span.nolinebreak {white-space:nowrap} 51span.roman {font-family:serif; font-weight:normal} 52span.sansserif {font-family:sans-serif; font-weight:normal} 53ul.no-bullet {list-style: none} 54--> 55</style> 56 57 58</head> 59 60<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> 61<a name="elfedit"></a> 62<div class="header"> 63<p> 64Next: <a href="Common-Options.html#Common-Options" accesskey="n" rel="next">Common Options</a>, Previous: <a href="readelf.html#readelf" accesskey="p" rel="previous">readelf</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p> 65</div> 66<hr> 67<a name="elfedit-1"></a> 68<h2 class="chapter">15 elfedit</h2> 69 70<a name="index-Update-ELF-header"></a> 71<a name="index-elfedit"></a> 72 73 74<div class="smallexample"> 75<pre class="smallexample">elfedit [<samp>--input-mach=</samp><var>machine</var>] 76 [<samp>--input-type=</samp><var>type</var>] 77 [<samp>--input-osabi=</samp><var>osabi</var>] 78 <samp>--output-mach=</samp><var>machine</var> 79 <samp>--output-type=</samp><var>type</var> 80 <samp>--output-osabi=</samp><var>osabi</var> 81 <samp>--enable-x86-feature=</samp><var>feature</var> 82 <samp>--disable-x86-feature=</samp><var>feature</var> 83 [<samp>-v</samp>|<samp>--version</samp>] 84 [<samp>-h</samp>|<samp>--help</samp>] 85 <var>elffile</var>… 86</pre></div> 87 88 89<p><code>elfedit</code> updates the ELF header and program property of ELF 90files which have the matching ELF machine and file types. The options 91control how and which fields in the ELF header and program property 92should be updated. 93</p> 94<p><var>elffile</var>… are the ELF files to be updated. 32-bit and 9564-bit ELF files are supported, as are archives containing ELF files. 96</p> 97 98<p>The long and short forms of options, shown here as alternatives, are 99equivalent. At least one of the <samp>--output-mach</samp>, 100<samp>--output-type</samp>, <samp>--output-osabi</samp>, 101<samp>--enable-x86-feature</samp> and <samp>--disable-x86-feature</samp> 102options must be given. 103</p> 104<dl compact="compact"> 105<dt><code>--input-mach=<var>machine</var></code></dt> 106<dd><p>Set the matching input ELF machine type to <var>machine</var>. If 107<samp>--input-mach</samp> isn’t specified, it will match any ELF 108machine types. 109</p> 110<p>The supported ELF machine types are, <var>i386</var>, <var>IAMCU</var>, <var>L1OM</var>, 111<var>K1OM</var> and <var>x86-64</var>. 112</p> 113</dd> 114<dt><code>--output-mach=<var>machine</var></code></dt> 115<dd><p>Change the ELF machine type in the ELF header to <var>machine</var>. The 116supported ELF machine types are the same as <samp>--input-mach</samp>. 117</p> 118</dd> 119<dt><code>--input-type=<var>type</var></code></dt> 120<dd><p>Set the matching input ELF file type to <var>type</var>. If 121<samp>--input-type</samp> isn’t specified, it will match any ELF file types. 122</p> 123<p>The supported ELF file types are, <var>rel</var>, <var>exec</var> and <var>dyn</var>. 124</p> 125</dd> 126<dt><code>--output-type=<var>type</var></code></dt> 127<dd><p>Change the ELF file type in the ELF header to <var>type</var>. The 128supported ELF types are the same as <samp>--input-type</samp>. 129</p> 130</dd> 131<dt><code>--input-osabi=<var>osabi</var></code></dt> 132<dd><p>Set the matching input ELF file OSABI to <var>osabi</var>. If 133<samp>--input-osabi</samp> isn’t specified, it will match any ELF OSABIs. 134</p> 135<p>The supported ELF OSABIs are, <var>none</var>, <var>HPUX</var>, <var>NetBSD</var>, 136<var>GNU</var>, <var>Linux</var> (alias for <var>GNU</var>), 137<var>Solaris</var>, <var>AIX</var>, <var>Irix</var>, 138<var>FreeBSD</var>, <var>TRU64</var>, <var>Modesto</var>, <var>OpenBSD</var>, <var>OpenVMS</var>, 139<var>NSK</var>, <var>AROS</var> and <var>FenixOS</var>. 140</p> 141</dd> 142<dt><code>--output-osabi=<var>osabi</var></code></dt> 143<dd><p>Change the ELF OSABI in the ELF header to <var>osabi</var>. The 144supported ELF OSABI are the same as <samp>--input-osabi</samp>. 145</p> 146</dd> 147<dt><code>--enable-x86-feature=<var>feature</var></code></dt> 148<dd><p>Set the <var>feature</var> bit in program property in <var>exec</var> or <var>dyn</var> 149ELF files with machine types of <var>i386</var> or <var>x86-64</var>. The 150supported features are, <var>ibt</var>, <var>shstk</var>, <var>lam_u48</var> and 151<var>lam_u57</var>. 152</p> 153</dd> 154<dt><code>--disable-x86-feature=<var>feature</var></code></dt> 155<dd><p>Clear the <var>feature</var> bit in program property in <var>exec</var> or 156<var>dyn</var> ELF files with machine types of <var>i386</var> or <var>x86-64</var>. 157The supported features are the same as <samp>--enable-x86-feature</samp>. 158</p> 159<p>Note: <samp>--enable-x86-feature</samp> and <samp>--disable-x86-feature</samp> 160are available only on hosts with ‘<samp>mmap</samp>’ support. 161</p> 162</dd> 163<dt><code>-v</code></dt> 164<dt><code>--version</code></dt> 165<dd><p>Display the version number of <code>elfedit</code>. 166</p> 167</dd> 168<dt><code>-h</code></dt> 169<dt><code>--help</code></dt> 170<dd><p>Display the command-line options understood by <code>elfedit</code>. 171</p> 172</dd> 173</dl> 174 175 176 177<hr> 178<div class="header"> 179<p> 180Next: <a href="Common-Options.html#Common-Options" accesskey="n" rel="next">Common Options</a>, Previous: <a href="readelf.html#readelf" accesskey="p" rel="previous">readelf</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p> 181</div> 182 183 184 185</body> 186</html> 187