Merge branch 'vendor/LIBRESSL'
[dragonfly.git] / contrib / binutils-2.27 / 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 "2016-08-03" "binutils-2.27" "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\-z\fR|\fB\-\-decompress\fR]
165         [\fB\-c\fR|\fB\-\-archive\-index\fR]
166         [\fB\-w[lLiaprmfFsoRt]\fR|
167          \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]]
168         [\fB\-\-dwarf\-depth=\fR\fIn\fR]
169         [\fB\-\-dwarf\-start=\fR\fIn\fR]
170         [\fB\-I\fR|\fB\-\-histogram\fR]
171         [\fB\-v\fR|\fB\-\-version\fR]
172         [\fB\-W\fR|\fB\-\-wide\fR]
173         [\fB\-H\fR|\fB\-\-help\fR]
174         \fIelffile\fR...
175 .SH "DESCRIPTION"
176 .IX Header "DESCRIPTION"
177 \&\fBreadelf\fR displays information about one or more \s-1ELF\s0 format object
178 files.  The options control what particular information to display.
179 .PP
180 \&\fIelffile\fR... are the object files to be examined.  32\-bit and
181 64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files.
182 .PP
183 This program performs a similar function to \fBobjdump\fR but it
184 goes into more detail and it exists independently of the \s-1BFD\s0
185 library, so if there is a bug in \s-1BFD\s0 then readelf will not be
186 affected.
187 .SH "OPTIONS"
188 .IX Header "OPTIONS"
189 The long and short forms of options, shown here as alternatives, are
190 equivalent.  At least one option besides \fB\-v\fR or \fB\-H\fR must be
191 given.
192 .IP "\fB\-a\fR" 4
193 .IX Item "-a"
194 .PD 0
195 .IP "\fB\-\-all\fR" 4
196 .IX Item "--all"
197 .PD
198 Equivalent to specifying \fB\-\-file\-header\fR,
199 \&\fB\-\-program\-headers\fR, \fB\-\-sections\fR, \fB\-\-symbols\fR,
200 \&\fB\-\-relocs\fR, \fB\-\-dynamic\fR, \fB\-\-notes\fR and
201 \&\fB\-\-version\-info\fR.
202 .IP "\fB\-h\fR" 4
203 .IX Item "-h"
204 .PD 0
205 .IP "\fB\-\-file\-header\fR" 4
206 .IX Item "--file-header"
207 .PD
208 Displays the information contained in the \s-1ELF\s0 header at the start of the
209 file.
210 .IP "\fB\-l\fR" 4
211 .IX Item "-l"
212 .PD 0
213 .IP "\fB\-\-program\-headers\fR" 4
214 .IX Item "--program-headers"
215 .IP "\fB\-\-segments\fR" 4
216 .IX Item "--segments"
217 .PD
218 Displays the information contained in the file's segment headers, if it
219 has any.
220 .IP "\fB\-S\fR" 4
221 .IX Item "-S"
222 .PD 0
223 .IP "\fB\-\-sections\fR" 4
224 .IX Item "--sections"
225 .IP "\fB\-\-section\-headers\fR" 4
226 .IX Item "--section-headers"
227 .PD
228 Displays the information contained in the file's section headers, if it
229 has any.
230 .IP "\fB\-g\fR" 4
231 .IX Item "-g"
232 .PD 0
233 .IP "\fB\-\-section\-groups\fR" 4
234 .IX Item "--section-groups"
235 .PD
236 Displays the information contained in the file's section groups, if it
237 has any.
238 .IP "\fB\-t\fR" 4
239 .IX Item "-t"
240 .PD 0
241 .IP "\fB\-\-section\-details\fR" 4
242 .IX Item "--section-details"
243 .PD
244 Displays the detailed section information. Implies \fB\-S\fR.
245 .IP "\fB\-s\fR" 4
246 .IX Item "-s"
247 .PD 0
248 .IP "\fB\-\-symbols\fR" 4
249 .IX Item "--symbols"
250 .IP "\fB\-\-syms\fR" 4
251 .IX Item "--syms"
252 .PD
253 Displays the entries in symbol table section of the file, if it has one.
254 .IP "\fB\-\-dyn\-syms\fR" 4
255 .IX Item "--dyn-syms"
256 Displays the entries in dynamic symbol table section of the file, if it
257 has one.
258 .IP "\fB\-e\fR" 4
259 .IX Item "-e"
260 .PD 0
261 .IP "\fB\-\-headers\fR" 4
262 .IX Item "--headers"
263 .PD
264 Display all the headers in the file.  Equivalent to \fB\-h \-l \-S\fR.
265 .IP "\fB\-n\fR" 4
266 .IX Item "-n"
267 .PD 0
268 .IP "\fB\-\-notes\fR" 4
269 .IX Item "--notes"
270 .PD
271 Displays the contents of the \s-1NOTE\s0 segments and/or sections, if any.
272 .IP "\fB\-r\fR" 4
273 .IX Item "-r"
274 .PD 0
275 .IP "\fB\-\-relocs\fR" 4
276 .IX Item "--relocs"
277 .PD
278 Displays the contents of the file's relocation section, if it has one.
279 .IP "\fB\-u\fR" 4
280 .IX Item "-u"
281 .PD 0
282 .IP "\fB\-\-unwind\fR" 4
283 .IX Item "--unwind"
284 .PD
285 Displays the contents of the file's unwind section, if it has one.  Only
286 the unwind sections for \s-1IA64 ELF\s0 files, as well as \s-1ARM\s0 unwind tables
287 (\f(CW\*(C`.ARM.exidx\*(C'\fR / \f(CW\*(C`.ARM.extab\*(C'\fR) are currently supported.
288 .IP "\fB\-d\fR" 4
289 .IX Item "-d"
290 .PD 0
291 .IP "\fB\-\-dynamic\fR" 4
292 .IX Item "--dynamic"
293 .PD
294 Displays the contents of the file's dynamic section, if it has one.
295 .IP "\fB\-V\fR" 4
296 .IX Item "-V"
297 .PD 0
298 .IP "\fB\-\-version\-info\fR" 4
299 .IX Item "--version-info"
300 .PD
301 Displays the contents of the version sections in the file, it they
302 exist.
303 .IP "\fB\-A\fR" 4
304 .IX Item "-A"
305 .PD 0
306 .IP "\fB\-\-arch\-specific\fR" 4
307 .IX Item "--arch-specific"
308 .PD
309 Displays architecture-specific information in the file, if there
310 is any.
311 .IP "\fB\-D\fR" 4
312 .IX Item "-D"
313 .PD 0
314 .IP "\fB\-\-use\-dynamic\fR" 4
315 .IX Item "--use-dynamic"
316 .PD
317 When displaying symbols, this option makes \fBreadelf\fR use the
318 symbol hash tables in the file's dynamic section, rather than the
319 symbol table sections.
320 .IP "\fB\-x <number or name>\fR" 4
321 .IX Item "-x <number or name>"
322 .PD 0
323 .IP "\fB\-\-hex\-dump=<number or name>\fR" 4
324 .IX Item "--hex-dump=<number or name>"
325 .PD
326 Displays the contents of the indicated section as a hexadecimal bytes.
327 A number identifies a particular section by index in the section table;
328 any other string identifies all sections with that name in the object file.
329 .IP "\fB\-R <number or name>\fR" 4
330 .IX Item "-R <number or name>"
331 .PD 0
332 .IP "\fB\-\-relocated\-dump=<number or name>\fR" 4
333 .IX Item "--relocated-dump=<number or name>"
334 .PD
335 Displays the contents of the indicated section as a hexadecimal
336 bytes.  A number identifies a particular section by index in the
337 section table; any other string identifies all sections with that name
338 in the object file.  The contents of the section will be relocated
339 before they are displayed.
340 .IP "\fB\-p <number or name>\fR" 4
341 .IX Item "-p <number or name>"
342 .PD 0
343 .IP "\fB\-\-string\-dump=<number or name>\fR" 4
344 .IX Item "--string-dump=<number or name>"
345 .PD
346 Displays the contents of the indicated section as printable strings.
347 A number identifies a particular section by index in the section table;
348 any other string identifies all sections with that name in the object file.
349 .IP "\fB\-z\fR" 4
350 .IX Item "-z"
351 .PD 0
352 .IP "\fB\-\-decompress\fR" 4
353 .IX Item "--decompress"
354 .PD
355 Requests that the section(s) being dumped by \fBx\fR, \fBR\fR or
356 \&\fBp\fR options are decompressed before being displayed.  If the
357 section(s) are not compressed then they are displayed as is.
358 .IP "\fB\-c\fR" 4
359 .IX Item "-c"
360 .PD 0
361 .IP "\fB\-\-archive\-index\fR" 4
362 .IX Item "--archive-index"
363 .PD
364 Displays the file symbol index information contained in the header part
365 of binary archives.  Performs the same function as the \fBt\fR
366 command to \fBar\fR, but without using the \s-1BFD\s0 library.
367 .IP "\fB\-w[lLiaprmfFsoRt]\fR" 4
368 .IX Item "-w[lLiaprmfFsoRt]"
369 .PD 0
370 .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
371 .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]"
372 .PD
373 Displays the contents of the debug sections in the file, if any are
374 present.  If one of the optional letters or words follows the switch
375 then only data found in those specific sections will be dumped.
376 .Sp
377 Note that there is no single letter option to display the content of
378 trace sections or .gdb_index.
379 .Sp
380 Note: the \fB=decodedline\fR option will display the interpreted
381 contents of a .debug_line section whereas the \fB=rawline\fR option
382 dumps the contents in a raw format.
383 .Sp
384 Note: the \fB=frames\-interp\fR option will display the interpreted
385 contents of a .debug_frame section whereas the \fB=frames\fR option
386 dumps the contents in a raw format.
387 .Sp
388 Note: the output from the \fB=info\fR option can also be affected
389 by the options \fB\-\-dwarf\-depth\fR and \fB\-\-dwarf\-start\fR.
390 .IP "\fB\-\-dwarf\-depth=\fR\fIn\fR" 4
391 .IX Item "--dwarf-depth=n"
392 Limit the dump of the \f(CW\*(C`.debug_info\*(C'\fR section to \fIn\fR children.
393 This is only useful with \fB\-\-debug\-dump=info\fR.  The default is
394 to print all DIEs; the special value 0 for \fIn\fR will also have this
395 effect.
396 .Sp
397 With a non-zero value for \fIn\fR, DIEs at or deeper than \fIn\fR
398 levels will not be printed.  The range for \fIn\fR is zero-based.
399 .IP "\fB\-\-dwarf\-start=\fR\fIn\fR" 4
400 .IX Item "--dwarf-start=n"
401 Print only DIEs beginning with the \s-1DIE\s0 numbered \fIn\fR.  This is only
402 useful with \fB\-\-debug\-dump=info\fR.
403 .Sp
404 If specified, this option will suppress printing of any header
405 information and all DIEs before the \s-1DIE\s0 numbered \fIn\fR.  Only
406 siblings and children of the specified \s-1DIE\s0 will be printed.
407 .Sp
408 This can be used in conjunction with \fB\-\-dwarf\-depth\fR.
409 .IP "\fB\-I\fR" 4
410 .IX Item "-I"
411 .PD 0
412 .IP "\fB\-\-histogram\fR" 4
413 .IX Item "--histogram"
414 .PD
415 Display a histogram of bucket list lengths when displaying the contents
416 of the symbol tables.
417 .IP "\fB\-v\fR" 4
418 .IX Item "-v"
419 .PD 0
420 .IP "\fB\-\-version\fR" 4
421 .IX Item "--version"
422 .PD
423 Display the version number of readelf.
424 .IP "\fB\-W\fR" 4
425 .IX Item "-W"
426 .PD 0
427 .IP "\fB\-\-wide\fR" 4
428 .IX Item "--wide"
429 .PD
430 Don't break output lines to fit into 80 columns. By default
431 \&\fBreadelf\fR breaks section header and segment listing lines for
432 64\-bit \s-1ELF\s0 files, so that they fit into 80 columns. This option causes
433 \&\fBreadelf\fR to print each section header resp. each segment one a
434 single line, which is far more readable on terminals wider than 80 columns.
435 .IP "\fB\-H\fR" 4
436 .IX Item "-H"
437 .PD 0
438 .IP "\fB\-\-help\fR" 4
439 .IX Item "--help"
440 .PD
441 Display the command line options understood by \fBreadelf\fR.
442 .IP "\fB@\fR\fIfile\fR" 4
443 .IX Item "@file"
444 Read command-line options from \fIfile\fR.  The options read are
445 inserted in place of the original @\fIfile\fR option.  If \fIfile\fR
446 does not exist, or cannot be read, then the option will be treated
447 literally, and not removed.
448 .Sp
449 Options in \fIfile\fR are separated by whitespace.  A whitespace
450 character may be included in an option by surrounding the entire
451 option in either single or double quotes.  Any character (including a
452 backslash) may be included by prefixing the character to be included
453 with a backslash.  The \fIfile\fR may itself contain additional
454 @\fIfile\fR options; any such options will be processed recursively.
455 .SH "SEE ALSO"
456 .IX Header "SEE ALSO"
457 \&\fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR.
458 .SH "COPYRIGHT"
459 .IX Header "COPYRIGHT"
460 Copyright (c) 1991\-2016 Free Software Foundation, Inc.
461 .PP
462 Permission is granted to copy, distribute and/or modify this document
463 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
464 or any later version published by the Free Software Foundation;
465 with no Invariant Sections, with no Front-Cover Texts, and with no
466 Back-Cover Texts.  A copy of the license is included in the
467 section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".