Merge branch 'vendor/LIBEDIT'
[dragonfly.git] / contrib / binutils-2.25 / binutils / doc / readelf.1
1 .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is turned on, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .nr rF 0
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{
60 .    if \nF \{
61 .        de IX
62 .        tm Index:\\$1\t\\n%\t"\\$2"
63 ..
64 .        if !\nF==2 \{
65 .            nr % 0
66 .            nr F 2
67 .        \}
68 .    \}
69 .\}
70 .rr rF
71 .\"
72 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
73 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
74 .    \" fudge factors for nroff and troff
75 .if n \{\
76 .    ds #H 0
77 .    ds #V .8m
78 .    ds #F .3m
79 .    ds #[ \f1
80 .    ds #] \fP
81 .\}
82 .if t \{\
83 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
84 .    ds #V .6m
85 .    ds #F 0
86 .    ds #[ \&
87 .    ds #] \&
88 .\}
89 .    \" simple accents for nroff and troff
90 .if n \{\
91 .    ds ' \&
92 .    ds ` \&
93 .    ds ^ \&
94 .    ds , \&
95 .    ds ~ ~
96 .    ds /
97 .\}
98 .if t \{\
99 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
100 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
101 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
102 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
103 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
104 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
105 .\}
106 .    \" troff and (daisy-wheel) nroff accents
107 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
108 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
109 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
110 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
111 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
112 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
113 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
114 .ds ae a\h'-(\w'a'u*4/10)'e
115 .ds Ae A\h'-(\w'A'u*4/10)'E
116 .    \" corrections for vroff
117 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
118 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
119 .    \" for low resolution devices (crt and lpr)
120 .if \n(.H>23 .if \n(.V>19 \
121 \{\
122 .    ds : e
123 .    ds 8 ss
124 .    ds o a
125 .    ds d- d\h'-1'\(ga
126 .    ds D- D\h'-1'\(hy
127 .    ds th \o'bp'
128 .    ds Th \o'LP'
129 .    ds ae ae
130 .    ds Ae AE
131 .\}
132 .rm #[ #] #H #V #F C
133 .\" ========================================================================
134 .\"
135 .IX Title "READELF 1"
136 .TH READELF 1 "2014-12-23" "binutils-2.25" "GNU Development Tools"
137 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
139 .if n .ad l
140 .nh
141 .SH "NAME"
142 readelf \- Displays information about ELF files.
143 .SH "SYNOPSIS"
144 .IX Header "SYNOPSIS"
145 readelf [\fB\-a\fR|\fB\-\-all\fR]
146         [\fB\-h\fR|\fB\-\-file\-header\fR]
147         [\fB\-l\fR|\fB\-\-program\-headers\fR|\fB\-\-segments\fR]
148         [\fB\-S\fR|\fB\-\-section\-headers\fR|\fB\-\-sections\fR]
149         [\fB\-g\fR|\fB\-\-section\-groups\fR]
150         [\fB\-t\fR|\fB\-\-section\-details\fR]
151         [\fB\-e\fR|\fB\-\-headers\fR]
152         [\fB\-s\fR|\fB\-\-syms\fR|\fB\-\-symbols\fR]
153         [\fB\-\-dyn\-syms\fR]
154         [\fB\-n\fR|\fB\-\-notes\fR]
155         [\fB\-r\fR|\fB\-\-relocs\fR]
156         [\fB\-u\fR|\fB\-\-unwind\fR]
157         [\fB\-d\fR|\fB\-\-dynamic\fR]
158         [\fB\-V\fR|\fB\-\-version\-info\fR]
159         [\fB\-A\fR|\fB\-\-arch\-specific\fR]
160         [\fB\-D\fR|\fB\-\-use\-dynamic\fR]
161         [\fB\-x\fR <number or name>|\fB\-\-hex\-dump=\fR<number or name>]
162         [\fB\-p\fR <number or name>|\fB\-\-string\-dump=\fR<number or name>]
163         [\fB\-R\fR <number or name>|\fB\-\-relocated\-dump=\fR<number or name>]
164         [\fB\-c\fR|\fB\-\-archive\-index\fR]
165         [\fB\-w[lLiaprmfFsoRt]\fR|
166          \fB\-\-debug\-dump\fR[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]]
167         [\fB\-\-dwarf\-depth=\fR\fIn\fR]
168         [\fB\-\-dwarf\-start=\fR\fIn\fR]
169         [\fB\-I\fR|\fB\-\-histogram\fR]
170         [\fB\-v\fR|\fB\-\-version\fR]
171         [\fB\-W\fR|\fB\-\-wide\fR]
172         [\fB\-H\fR|\fB\-\-help\fR]
173         \fIelffile\fR...
174 .SH "DESCRIPTION"
175 .IX Header "DESCRIPTION"
176 \&\fBreadelf\fR displays information about one or more \s-1ELF\s0 format object
177 files.  The options control what particular information to display.
178 .PP
179 \&\fIelffile\fR... are the object files to be examined.  32\-bit and
180 64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files.
181 .PP
182 This program performs a similar function to \fBobjdump\fR but it
183 goes into more detail and it exists independently of the \s-1BFD\s0
184 library, so if there is a bug in \s-1BFD\s0 then readelf will not be
185 affected.
186 .SH "OPTIONS"
187 .IX Header "OPTIONS"
188 The long and short forms of options, shown here as alternatives, are
189 equivalent.  At least one option besides \fB\-v\fR or \fB\-H\fR must be
190 given.
191 .IP "\fB\-a\fR" 4
192 .IX Item "-a"
193 .PD 0
194 .IP "\fB\-\-all\fR" 4
195 .IX Item "--all"
196 .PD
197 Equivalent to specifying \fB\-\-file\-header\fR,
198 \&\fB\-\-program\-headers\fR, \fB\-\-sections\fR, \fB\-\-symbols\fR,
199 \&\fB\-\-relocs\fR, \fB\-\-dynamic\fR, \fB\-\-notes\fR and
200 \&\fB\-\-version\-info\fR.
201 .IP "\fB\-h\fR" 4
202 .IX Item "-h"
203 .PD 0
204 .IP "\fB\-\-file\-header\fR" 4
205 .IX Item "--file-header"
206 .PD
207 Displays the information contained in the \s-1ELF\s0 header at the start of the
208 file.
209 .IP "\fB\-l\fR" 4
210 .IX Item "-l"
211 .PD 0
212 .IP "\fB\-\-program\-headers\fR" 4
213 .IX Item "--program-headers"
214 .IP "\fB\-\-segments\fR" 4
215 .IX Item "--segments"
216 .PD
217 Displays the information contained in the file's segment headers, if it
218 has any.
219 .IP "\fB\-S\fR" 4
220 .IX Item "-S"
221 .PD 0
222 .IP "\fB\-\-sections\fR" 4
223 .IX Item "--sections"
224 .IP "\fB\-\-section\-headers\fR" 4
225 .IX Item "--section-headers"
226 .PD
227 Displays the information contained in the file's section headers, if it
228 has any.
229 .IP "\fB\-g\fR" 4
230 .IX Item "-g"
231 .PD 0
232 .IP "\fB\-\-section\-groups\fR" 4
233 .IX Item "--section-groups"
234 .PD
235 Displays the information contained in the file's section groups, if it
236 has any.
237 .IP "\fB\-t\fR" 4
238 .IX Item "-t"
239 .PD 0
240 .IP "\fB\-\-section\-details\fR" 4
241 .IX Item "--section-details"
242 .PD
243 Displays the detailed section information. Implies \fB\-S\fR.
244 .IP "\fB\-s\fR" 4
245 .IX Item "-s"
246 .PD 0
247 .IP "\fB\-\-symbols\fR" 4
248 .IX Item "--symbols"
249 .IP "\fB\-\-syms\fR" 4
250 .IX Item "--syms"
251 .PD
252 Displays the entries in symbol table section of the file, if it has one.
253 .IP "\fB\-\-dyn\-syms\fR" 4
254 .IX Item "--dyn-syms"
255 Displays the entries in dynamic symbol table section of the file, if it
256 has one.
257 .IP "\fB\-e\fR" 4
258 .IX Item "-e"
259 .PD 0
260 .IP "\fB\-\-headers\fR" 4
261 .IX Item "--headers"
262 .PD
263 Display all the headers in the file.  Equivalent to \fB\-h \-l \-S\fR.
264 .IP "\fB\-n\fR" 4
265 .IX Item "-n"
266 .PD 0
267 .IP "\fB\-\-notes\fR" 4
268 .IX Item "--notes"
269 .PD
270 Displays the contents of the \s-1NOTE\s0 segments and/or sections, if any.
271 .IP "\fB\-r\fR" 4
272 .IX Item "-r"
273 .PD 0
274 .IP "\fB\-\-relocs\fR" 4
275 .IX Item "--relocs"
276 .PD
277 Displays the contents of the file's relocation section, if it has one.
278 .IP "\fB\-u\fR" 4
279 .IX Item "-u"
280 .PD 0
281 .IP "\fB\-\-unwind\fR" 4
282 .IX Item "--unwind"
283 .PD
284 Displays the contents of the file's unwind section, if it has one.  Only
285 the unwind sections for \s-1IA64 ELF\s0 files, as well as \s-1ARM\s0 unwind tables
286 (\f(CW\*(C`.ARM.exidx\*(C'\fR / \f(CW\*(C`.ARM.extab\*(C'\fR) are currently supported.
287 .IP "\fB\-d\fR" 4
288 .IX Item "-d"
289 .PD 0
290 .IP "\fB\-\-dynamic\fR" 4
291 .IX Item "--dynamic"
292 .PD
293 Displays the contents of the file's dynamic section, if it has one.
294 .IP "\fB\-V\fR" 4
295 .IX Item "-V"
296 .PD 0
297 .IP "\fB\-\-version\-info\fR" 4
298 .IX Item "--version-info"
299 .PD
300 Displays the contents of the version sections in the file, it they
301 exist.
302 .IP "\fB\-A\fR" 4
303 .IX Item "-A"
304 .PD 0
305 .IP "\fB\-\-arch\-specific\fR" 4
306 .IX Item "--arch-specific"
307 .PD
308 Displays architecture-specific information in the file, if there
309 is any.
310 .IP "\fB\-D\fR" 4
311 .IX Item "-D"
312 .PD 0
313 .IP "\fB\-\-use\-dynamic\fR" 4
314 .IX Item "--use-dynamic"
315 .PD
316 When displaying symbols, this option makes \fBreadelf\fR use the
317 symbol hash tables in the file's dynamic section, rather than the
318 symbol table sections.
319 .IP "\fB\-x <number or name>\fR" 4
320 .IX Item "-x <number or name>"
321 .PD 0
322 .IP "\fB\-\-hex\-dump=<number or name>\fR" 4
323 .IX Item "--hex-dump=<number or name>"
324 .PD
325 Displays the contents of the indicated section as a hexadecimal bytes.
326 A number identifies a particular section by index in the section table;
327 any other string identifies all sections with that name in the object file.
328 .IP "\fB\-R <number or name>\fR" 4
329 .IX Item "-R <number or name>"
330 .PD 0
331 .IP "\fB\-\-relocated\-dump=<number or name>\fR" 4
332 .IX Item "--relocated-dump=<number or name>"
333 .PD
334 Displays the contents of the indicated section as a hexadecimal
335 bytes.  A number identifies a particular section by index in the
336 section table; any other string identifies all sections with that name
337 in the object file.  The contents of the section will be relocated
338 before they are displayed.
339 .IP "\fB\-p <number or name>\fR" 4
340 .IX Item "-p <number or name>"
341 .PD 0
342 .IP "\fB\-\-string\-dump=<number or name>\fR" 4
343 .IX Item "--string-dump=<number or name>"
344 .PD
345 Displays the contents of the indicated section as printable strings.
346 A number identifies a particular section by index in the section table;
347 any other string identifies all sections with that name in the object file.
348 .IP "\fB\-c\fR" 4
349 .IX Item "-c"
350 .PD 0
351 .IP "\fB\-\-archive\-index\fR" 4
352 .IX Item "--archive-index"
353 .PD
354 Displays the file symbol index information contained in the header part
355 of binary archives.  Performs the same function as the \fBt\fR
356 command to \fBar\fR, but without using the \s-1BFD\s0 library.
357 .IP "\fB\-w[lLiaprmfFsoRt]\fR" 4
358 .IX Item "-w[lLiaprmfFsoRt]"
359 .PD 0
360 .IP "\fB\-\-debug\-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]\fR" 4
361 .IX Item "--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index]"
362 .PD
363 Displays the contents of the debug sections in the file, if any are
364 present.  If one of the optional letters or words follows the switch
365 then only data found in those specific sections will be dumped.
366 .Sp
367 Note that there is no single letter option to display the content of
368 trace sections or .gdb_index.
369 .Sp
370 Note: the \fB=decodedline\fR option will display the interpreted
371 contents of a .debug_line section whereas the \fB=rawline\fR option
372 dumps the contents in a raw format.
373 .Sp
374 Note: the \fB=frames\-interp\fR option will display the interpreted
375 contents of a .debug_frame section whereas the \fB=frames\fR option
376 dumps the contents in a raw format.
377 .Sp
378 Note: the output from the \fB=info\fR option can also be affected
379 by the options \fB\-\-dwarf\-depth\fR and \fB\-\-dwarf\-start\fR.
380 .IP "\fB\-\-dwarf\-depth=\fR\fIn\fR" 4
381 .IX Item "--dwarf-depth=n"
382 Limit the dump of the \f(CW\*(C`.debug_info\*(C'\fR section to \fIn\fR children.
383 This is only useful with \fB\-\-debug\-dump=info\fR.  The default is
384 to print all DIEs; the special value 0 for \fIn\fR will also have this
385 effect.
386 .Sp
387 With a non-zero value for \fIn\fR, DIEs at or deeper than \fIn\fR
388 levels will not be printed.  The range for \fIn\fR is zero-based.
389 .IP "\fB\-\-dwarf\-start=\fR\fIn\fR" 4
390 .IX Item "--dwarf-start=n"
391 Print only DIEs beginning with the \s-1DIE\s0 numbered \fIn\fR.  This is only
392 useful with \fB\-\-debug\-dump=info\fR.
393 .Sp
394 If specified, this option will suppress printing of any header
395 information and all DIEs before the \s-1DIE\s0 numbered \fIn\fR.  Only
396 siblings and children of the specified \s-1DIE\s0 will be printed.
397 .Sp
398 This can be used in conjunction with \fB\-\-dwarf\-depth\fR.
399 .IP "\fB\-I\fR" 4
400 .IX Item "-I"
401 .PD 0
402 .IP "\fB\-\-histogram\fR" 4
403 .IX Item "--histogram"
404 .PD
405 Display a histogram of bucket list lengths when displaying the contents
406 of the symbol tables.
407 .IP "\fB\-v\fR" 4
408 .IX Item "-v"
409 .PD 0
410 .IP "\fB\-\-version\fR" 4
411 .IX Item "--version"
412 .PD
413 Display the version number of readelf.
414 .IP "\fB\-W\fR" 4
415 .IX Item "-W"
416 .PD 0
417 .IP "\fB\-\-wide\fR" 4
418 .IX Item "--wide"
419 .PD
420 Don't break output lines to fit into 80 columns. By default
421 \&\fBreadelf\fR breaks section header and segment listing lines for
422 64\-bit \s-1ELF\s0 files, so that they fit into 80 columns. This option causes
423 \&\fBreadelf\fR to print each section header resp. each segment one a
424 single line, which is far more readable on terminals wider than 80 columns.
425 .IP "\fB\-H\fR" 4
426 .IX Item "-H"
427 .PD 0
428 .IP "\fB\-\-help\fR" 4
429 .IX Item "--help"
430 .PD
431 Display the command line options understood by \fBreadelf\fR.
432 .IP "\fB@\fR\fIfile\fR" 4
433 .IX Item "@file"
434 Read command-line options from \fIfile\fR.  The options read are
435 inserted in place of the original @\fIfile\fR option.  If \fIfile\fR
436 does not exist, or cannot be read, then the option will be treated
437 literally, and not removed.
438 .Sp
439 Options in \fIfile\fR are separated by whitespace.  A whitespace
440 character may be included in an option by surrounding the entire
441 option in either single or double quotes.  Any character (including a
442 backslash) may be included by prefixing the character to be included
443 with a backslash.  The \fIfile\fR may itself contain additional
444 @\fIfile\fR options; any such options will be processed recursively.
445 .SH "SEE ALSO"
446 .IX Header "SEE ALSO"
447 \&\fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR.
448 .SH "COPYRIGHT"
449 .IX Header "COPYRIGHT"
450 Copyright (c) 1991\-2014 Free Software Foundation, Inc.
451 .PP
452 Permission is granted to copy, distribute and/or modify this document
453 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
454 or any later version published by the Free Software Foundation;
455 with no Invariant Sections, with no Front-Cover Texts, and with no
456 Back-Cover Texts.  A copy of the license is included in the
457 section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".