1<html lang="en"> 2<head> 3<title>readelf - GNU Binary Utilities</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="GNU Binary Utilities"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="prev" href="ranlib.html#ranlib" title="ranlib"> 9<link rel="next" href="size.html#size" title="size"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<!-- 12Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 132000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 14Free Software Foundation, Inc. 15 16Permission is granted to copy, distribute and/or modify this document 17under the terms of the GNU Free Documentation License, Version 1.3 18or any later version published by the Free Software Foundation; 19with no Invariant Sections, with no Front-Cover Texts, and with no 20Back-Cover Texts. A copy of the license is included in the 21section entitled ``GNU Free Documentation License''. 22 23--> 24<meta http-equiv="Content-Style-Type" content="text/css"> 25<style type="text/css"><!-- 26 pre.display { font-family:inherit } 27 pre.format { font-family:inherit } 28 pre.smalldisplay { font-family:inherit; font-size:smaller } 29 pre.smallformat { font-family:inherit; font-size:smaller } 30 pre.smallexample { font-size:smaller } 31 pre.smalllisp { font-size:smaller } 32 span.sc { font-variant:small-caps } 33 span.roman { font-family:serif; font-weight:normal; } 34 span.sansserif { font-family:sans-serif; font-weight:normal; } 35--></style> 36<link rel="stylesheet" type="text/css" href="../cs.css"> 37</head> 38<body> 39<div class="node"> 40<a name="readelf"></a> 41<p> 42Next: <a rel="next" accesskey="n" href="size.html#size">size</a>, 43Previous: <a rel="previous" accesskey="p" href="ranlib.html#ranlib">ranlib</a>, 44Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a> 45<hr> 46</div> 47 48<h2 class="chapter">15 readelf</h2> 49 50<p><a name="index-ELF-file-information-132"></a><a name="index-readelf-133"></a> 51<!-- man title readelf Displays information about ELF files. --> 52 53<pre class="smallexample"> <!-- man begin SYNOPSIS readelf --> 54 readelf [<samp><span class="option">-a</span></samp>|<samp><span class="option">--all</span></samp>] 55 [<samp><span class="option">-h</span></samp>|<samp><span class="option">--file-header</span></samp>] 56 [<samp><span class="option">-l</span></samp>|<samp><span class="option">--program-headers</span></samp>|<samp><span class="option">--segments</span></samp>] 57 [<samp><span class="option">-S</span></samp>|<samp><span class="option">--section-headers</span></samp>|<samp><span class="option">--sections</span></samp>] 58 [<samp><span class="option">-g</span></samp>|<samp><span class="option">--section-groups</span></samp>] 59 [<samp><span class="option">-t</span></samp>|<samp><span class="option">--section-details</span></samp>] 60 [<samp><span class="option">-e</span></samp>|<samp><span class="option">--headers</span></samp>] 61 [<samp><span class="option">-s</span></samp>|<samp><span class="option">--syms</span></samp>|<samp><span class="option">--symbols</span></samp>] 62 [<samp><span class="option">--dyn-syms</span></samp>] 63 [<samp><span class="option">-n</span></samp>|<samp><span class="option">--notes</span></samp>] 64 [<samp><span class="option">-r</span></samp>|<samp><span class="option">--relocs</span></samp>] 65 [<samp><span class="option">-u</span></samp>|<samp><span class="option">--unwind</span></samp>] 66 [<samp><span class="option">-d</span></samp>|<samp><span class="option">--dynamic</span></samp>] 67 [<samp><span class="option">-V</span></samp>|<samp><span class="option">--version-info</span></samp>] 68 [<samp><span class="option">-A</span></samp>|<samp><span class="option">--arch-specific</span></samp>] 69 [<samp><span class="option">-D</span></samp>|<samp><span class="option">--use-dynamic</span></samp>] 70 [<samp><span class="option">-x</span></samp> <number or name>|<samp><span class="option">--hex-dump=</span></samp><number or name>] 71 [<samp><span class="option">-p</span></samp> <number or name>|<samp><span class="option">--string-dump=</span></samp><number or name>] 72 [<samp><span class="option">-R</span></samp> <number or name>|<samp><span class="option">--relocated-dump=</span></samp><number or name>] 73 [<samp><span class="option">-c</span></samp>|<samp><span class="option">--archive-index</span></samp>] 74 [<samp><span class="option">-w[lLiaprmfFsoRt]</span></samp>| 75 <samp><span class="option">--debug-dump</span></samp>[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]] 76 [<samp><span class="option">--dwarf-depth=</span><var>n</var></samp>] 77 [<samp><span class="option">--dwarf-start=</span><var>n</var></samp>] 78 [<samp><span class="option">-I</span></samp>|<samp><span class="option">--histogram</span></samp>] 79 [<samp><span class="option">-v</span></samp>|<samp><span class="option">--version</span></samp>] 80 [<samp><span class="option">-W</span></samp>|<samp><span class="option">--wide</span></samp>] 81 [<samp><span class="option">-H</span></samp>|<samp><span class="option">--help</span></samp>] 82 <var>elffile</var>... 83 <!-- man end --> 84</pre> 85 <!-- man begin DESCRIPTION readelf --> 86 <p><samp><span class="command">readelf</span></samp> displays information about one or more ELF format object 87files. The options control what particular information to display. 88 89 <p><var>elffile</var><small class="dots">...</small> are the object files to be examined. 32-bit and 9064-bit ELF files are supported, as are archives containing ELF files. 91 92 <p>This program performs a similar function to <samp><span class="command">objdump</span></samp> but it 93goes into more detail and it exists independently of the <span class="sc">bfd</span> 94library, so if there is a bug in <span class="sc">bfd</span> then readelf will not be 95affected. 96 97<!-- man end --> 98<!-- man begin OPTIONS readelf --> 99 <p>The long and short forms of options, shown here as alternatives, are 100equivalent. At least one option besides ‘<samp><span class="samp">-v</span></samp>’ or ‘<samp><span class="samp">-H</span></samp>’ must be 101given. 102 103 <dl> 104<dt><samp><span class="env">-a</span></samp><dt><samp><span class="env">--all</span></samp><dd>Equivalent to specifying <samp><span class="option">--file-header</span></samp>, 105<samp><span class="option">--program-headers</span></samp>, <samp><span class="option">--sections</span></samp>, <samp><span class="option">--symbols</span></samp>, 106<samp><span class="option">--relocs</span></samp>, <samp><span class="option">--dynamic</span></samp>, <samp><span class="option">--notes</span></samp> and 107<samp><span class="option">--version-info</span></samp>. 108 109 <br><dt><samp><span class="env">-h</span></samp><dt><samp><span class="env">--file-header</span></samp><dd><a name="index-ELF-file-header-information-134"></a>Displays the information contained in the ELF header at the start of the 110file. 111 112 <br><dt><samp><span class="env">-l</span></samp><dt><samp><span class="env">--program-headers</span></samp><dt><samp><span class="env">--segments</span></samp><dd><a name="index-ELF-program-header-information-135"></a><a name="index-ELF-segment-information-136"></a>Displays the information contained in the file's segment headers, if it 113has any. 114 115 <br><dt><samp><span class="env">-S</span></samp><dt><samp><span class="env">--sections</span></samp><dt><samp><span class="env">--section-headers</span></samp><dd><a name="index-ELF-section-information-137"></a>Displays the information contained in the file's section headers, if it 116has any. 117 118 <br><dt><samp><span class="env">-g</span></samp><dt><samp><span class="env">--section-groups</span></samp><dd><a name="index-ELF-section-group-information-138"></a>Displays the information contained in the file's section groups, if it 119has any. 120 121 <br><dt><samp><span class="env">-t</span></samp><dt><samp><span class="env">--section-details</span></samp><dd><a name="index-ELF-section-information-139"></a>Displays the detailed section information. Implies <samp><span class="option">-S</span></samp>. 122 123 <br><dt><samp><span class="env">-s</span></samp><dt><samp><span class="env">--symbols</span></samp><dt><samp><span class="env">--syms</span></samp><dd><a name="index-ELF-symbol-table-information-140"></a>Displays the entries in symbol table section of the file, if it has one. 124 125 <br><dt><samp><span class="env">--dyn-syms</span></samp><dd><a name="index-ELF-dynamic-symbol-table-information-141"></a>Displays the entries in dynamic symbol table section of the file, if it 126has one. 127 128 <br><dt><samp><span class="env">-e</span></samp><dt><samp><span class="env">--headers</span></samp><dd>Display all the headers in the file. Equivalent to <samp><span class="option">-h -l -S</span></samp>. 129 130 <br><dt><samp><span class="env">-n</span></samp><dt><samp><span class="env">--notes</span></samp><dd><a name="index-ELF-notes-142"></a>Displays the contents of the NOTE segments and/or sections, if any. 131 132 <br><dt><samp><span class="env">-r</span></samp><dt><samp><span class="env">--relocs</span></samp><dd><a name="index-ELF-reloc-information-143"></a>Displays the contents of the file's relocation section, if it has one. 133 134 <br><dt><samp><span class="env">-u</span></samp><dt><samp><span class="env">--unwind</span></samp><dd><a name="index-unwind-information-144"></a>Displays the contents of the file's unwind section, if it has one. Only 135the unwind sections for IA64 ELF files, as well as ARM unwind tables 136(<code>.ARM.exidx</code> / <code>.ARM.extab</code>) are currently supported. 137 138 <br><dt><samp><span class="env">-d</span></samp><dt><samp><span class="env">--dynamic</span></samp><dd><a name="index-ELF-dynamic-section-information-145"></a>Displays the contents of the file's dynamic section, if it has one. 139 140 <br><dt><samp><span class="env">-V</span></samp><dt><samp><span class="env">--version-info</span></samp><dd><a name="index-ELF-version-sections-informations-146"></a>Displays the contents of the version sections in the file, it they 141exist. 142 143 <br><dt><samp><span class="env">-A</span></samp><dt><samp><span class="env">--arch-specific</span></samp><dd>Displays architecture-specific information in the file, if there 144is any. 145 146 <br><dt><samp><span class="env">-D</span></samp><dt><samp><span class="env">--use-dynamic</span></samp><dd>When displaying symbols, this option makes <samp><span class="command">readelf</span></samp> use the 147symbol hash tables in the file's dynamic section, rather than the 148symbol table sections. 149 150 <br><dt><samp><span class="env">-x <number or name></span></samp><dt><samp><span class="env">--hex-dump=<number or name></span></samp><dd>Displays the contents of the indicated section as a hexadecimal bytes. 151A number identifies a particular section by index in the section table; 152any other string identifies all sections with that name in the object file. 153 154 <br><dt><samp><span class="env">-R <number or name></span></samp><dt><samp><span class="env">--relocated-dump=<number or name></span></samp><dd>Displays the contents of the indicated section as a hexadecimal 155bytes. A number identifies a particular section by index in the 156section table; any other string identifies all sections with that name 157in the object file. The contents of the section will be relocated 158before they are displayed. 159 160 <br><dt><samp><span class="env">-p <number or name></span></samp><dt><samp><span class="env">--string-dump=<number or name></span></samp><dd>Displays the contents of the indicated section as printable strings. 161A number identifies a particular section by index in the section table; 162any other string identifies all sections with that name in the object file. 163 164 <br><dt><samp><span class="env">-c</span></samp><dt><samp><span class="env">--archive-index</span></samp><dd><a name="index-Archive-file-symbol-index-information-147"></a>Displays the file symbol index infomation contained in the header part 165of binary archives. Performs the same function as the <samp><span class="option">t</span></samp> 166command to <samp><span class="command">ar</span></samp>, but without using the BFD library. See <a href="ar.html#ar">ar</a>. 167 168 <br><dt><samp><span class="env">-w[lLiaprmfFsoRt]</span></samp><dt><samp><span class="env">--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]</span></samp><dd>Displays the contents of the debug sections in the file, if any are 169present. If one of the optional letters or words follows the switch 170then only data found in those specific sections will be dumped. 171 172 <p>Note that there is no single letter option to display the content of 173trace sections or .gdb_index. 174 175 <p>Note: the <samp><span class="option">=decodedline</span></samp> option will display the interpreted 176contents of a .debug_line section whereas the <samp><span class="option">=rawline</span></samp> option 177dumps the contents in a raw format. 178 179 <p>Note: the <samp><span class="option">=frames-interp</span></samp> option will display the interpreted 180contents of a .debug_frame section whereas the <samp><span class="option">=frames</span></samp> option 181dumps the contents in a raw format. 182 183 <p>Note: the output from the <samp><span class="option">=info</span></samp> option can also be affected 184by the options <samp><span class="option">--dwarf-depth</span></samp> and <samp><span class="option">--dwarf-start</span></samp>. 185 186 <br><dt><samp><span class="env">--dwarf-depth=</span><var>n</var></samp><dd>Limit the dump of the <code>.debug_info</code> section to <var>n</var> children. 187This is only useful with <samp><span class="option">--debug-dump=info</span></samp>. The default is 188to print all DIEs; the special value 0 for <var>n</var> will also have this 189effect. 190 191 <p>With a non-zero value for <var>n</var>, DIEs at or deeper than <var>n</var> 192levels will not be printed. The range for <var>n</var> is zero-based. 193 194 <br><dt><samp><span class="env">--dwarf-start=</span><var>n</var></samp><dd>Print only DIEs beginning with the DIE numbered <var>n</var>. This is only 195useful with <samp><span class="option">--debug-dump=info</span></samp>. 196 197 <p>If specified, this option will suppress printing of any header 198information and all DIEs before the DIE numbered <var>n</var>. Only 199siblings and children of the specified DIE will be printed. 200 201 <p>This can be used in conjunction with <samp><span class="option">--dwarf-depth</span></samp>. 202 203 <br><dt><samp><span class="env">-I</span></samp><dt><samp><span class="env">--histogram</span></samp><dd>Display a histogram of bucket list lengths when displaying the contents 204of the symbol tables. 205 206 <br><dt><samp><span class="env">-v</span></samp><dt><samp><span class="env">--version</span></samp><dd>Display the version number of readelf. 207 208 <br><dt><samp><span class="env">-W</span></samp><dt><samp><span class="env">--wide</span></samp><dd>Don't break output lines to fit into 80 columns. By default 209<samp><span class="command">readelf</span></samp> breaks section header and segment listing lines for 21064-bit ELF files, so that they fit into 80 columns. This option causes 211<samp><span class="command">readelf</span></samp> to print each section header resp. each segment one a 212single line, which is far more readable on terminals wider than 80 columns. 213 214 <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">readelf</span></samp>. 215 216 </dl> 217 218<!-- man end --> 219 </body></html> 220 221