1READELF(1)                   GNU Development Tools                  READELF(1)
2
3
4

NAME

6       readelf - display information about ELF files
7

SYNOPSIS

9       readelf [-a|--all]
10               [-h|--file-header]
11               [-l|--program-headers|--segments]
12               [-S|--section-headers|--sections]
13               [-g|--section-groups]
14               [-t|--section-details]
15               [-e|--headers]
16               [-s|--syms|--symbols]
17               [--dyn-syms]
18               [-n|--notes]
19               [-r|--relocs]
20               [-u|--unwind]
21               [-d|--dynamic]
22               [-V|--version-info]
23               [-A|--arch-specific]
24               [-D|--use-dynamic]
25               [-x <number or name>|--hex-dump=<number or name>]
26               [-p <number or name>|--string-dump=<number or name>]
27               [-R <number or name>|--relocated-dump=<number or name>]
28               [-z|--decompress]
29               [-c|--archive-index]
30               [-w[lLiaprmfFsoRtUuTgAckK]|
31                --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]]
32               [--dwarf-depth=n]
33               [--dwarf-start=n]
34               [--ctf=section]
35               [--ctf-parent=section]
36               [--ctf-symbols=section]
37               [--ctf-strings=section]
38               [-I|--histogram]
39               [-v|--version]
40               [-W|--wide]
41               [-H|--help]
42               elffile...
43

DESCRIPTION

45       readelf displays information about one or more ELF format object files.
46       The options control what particular information to display.
47
48       elffile... are the object files to be examined.  32-bit and 64-bit ELF
49       files are supported, as are archives containing ELF files.
50
51       This program performs a similar function to objdump but it goes into
52       more detail and it exists independently of the BFD library, so if there
53       is a bug in BFD then readelf will not be affected.
54

OPTIONS

56       The long and short forms of options, shown here as alternatives, are
57       equivalent.  At least one option besides -v or -H must be given.
58
59       -a
60       --all
61           Equivalent to specifying --file-header, --program-headers,
62           --sections, --symbols, --relocs, --dynamic, --notes,
63           --version-info, --arch-specific, --unwind, --section-groups and
64           --histogram.
65
66           Note - this option does not enable --use-dynamic itself, so if that
67           option is not present on the command line then dynamic symbols and
68           dynamic relocs will not be displayed.
69
70       -h
71       --file-header
72           Displays the information contained in the ELF header at the start
73           of the file.
74
75       -l
76       --program-headers
77       --segments
78           Displays the information contained in the file's segment headers,
79           if it has any.
80
81       -S
82       --sections
83       --section-headers
84           Displays the information contained in the file's section headers,
85           if it has any.
86
87       -g
88       --section-groups
89           Displays the information contained in the file's section groups, if
90           it has any.
91
92       -t
93       --section-details
94           Displays the detailed section information. Implies -S.
95
96       -s
97       --symbols
98       --syms
99           Displays the entries in symbol table section of the file, if it has
100           one.  If a symbol has version information associated with it then
101           this is displayed as well.  The version string is displayed as a
102           suffix to the symbol name, preceeded by an @ character.  For
103           example foo@VER_1.  If the version is the default version to be
104           used when resolving unversioned references to the symbol then it is
105           displayed as a suffix preceeded by two @ characters.  For example
106           foo@@VER_2.
107
108       --dyn-syms
109           Displays the entries in dynamic symbol table section of the file,
110           if it has one.  The output format is the same as the format used by
111           the --syms option.
112
113       -e
114       --headers
115           Display all the headers in the file.  Equivalent to -h -l -S.
116
117       -n
118       --notes
119           Displays the contents of the NOTE segments and/or sections, if any.
120
121       -r
122       --relocs
123           Displays the contents of the file's relocation section, if it has
124           one.
125
126       -u
127       --unwind
128           Displays the contents of the file's unwind section, if it has one.
129           Only the unwind sections for IA64 ELF files, as well as ARM unwind
130           tables (".ARM.exidx" / ".ARM.extab") are currently supported.  If
131           support is not yet implemented for your architecture you could try
132           dumping the contents of the .eh_frames section using the
133           --debug-dump=frames or --debug-dump=frames-interp options.
134
135       -d
136       --dynamic
137           Displays the contents of the file's dynamic section, if it has one.
138
139       -V
140       --version-info
141           Displays the contents of the version sections in the file, it they
142           exist.
143
144       -A
145       --arch-specific
146           Displays architecture-specific information in the file, if there is
147           any.
148
149       -D
150       --use-dynamic
151           When displaying symbols, this option makes readelf use the symbol
152           hash tables in the file's dynamic section, rather than the symbol
153           table sections.
154
155           When displaying relocations, this option makes readelf display the
156           dynamic relocations rather than the static relocations.
157
158       -x <number or name>
159       --hex-dump=<number or name>
160           Displays the contents of the indicated section as a hexadecimal
161           bytes.  A number identifies a particular section by index in the
162           section table; any other string identifies all sections with that
163           name in the object file.
164
165       -R <number or name>
166       --relocated-dump=<number or name>
167           Displays the contents of the indicated section as a hexadecimal
168           bytes.  A number identifies a particular section by index in the
169           section table; any other string identifies all sections with that
170           name in the object file.  The contents of the section will be
171           relocated before they are displayed.
172
173       -p <number or name>
174       --string-dump=<number or name>
175           Displays the contents of the indicated section as printable
176           strings.  A number identifies a particular section by index in the
177           section table; any other string identifies all sections with that
178           name in the object file.
179
180       -z
181       --decompress
182           Requests that the section(s) being dumped by x, R or p options are
183           decompressed before being displayed.  If the section(s) are not
184           compressed then they are displayed as is.
185
186       -c
187       --archive-index
188           Displays the file symbol index information contained in the header
189           part of binary archives.  Performs the same function as the t
190           command to ar, but without using the BFD library.
191
192       -w[lLiaprmfFsoRtUuTgAckK]
193       --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]
194           Displays the contents of the DWARF debug sections in the file, if
195           any are present.  Compressed debug sections are automatically
196           decompressed (temporarily) before they are displayed.  If one or
197           more of the optional letters or words follows the switch then only
198           those type(s) of data will be dumped.  The letters and words refer
199           to the following information:
200
201           "a"
202           "=abbrev"
203               Displays the contents of the .debug_abbrev section.
204
205           "A"
206           "=addr"
207               Displays the contents of the .debug_addr section.
208
209           "c"
210           "=cu_index"
211               Displays the contents of the .debug_cu_index and/or
212               .debug_tu_index sections.
213
214           "f"
215           "=frames"
216               Display the raw contents of a .debug_frame section.
217
218           "F"
219           "=frame-interp"
220               Display the interpreted contents of a .debug_frame section.
221
222           "g"
223           "=gdb_index"
224               Displays the contents of the .gdb_index and/or .debug_names
225               sections.
226
227           "i"
228           "=info"
229               Displays the contents of the .debug_info section.  Note: the
230               output from this option can also be restricted by the use of
231               the --dwarf-depth and --dwarf-start options.
232
233           "k"
234           "=links"
235               Displays the contents of the .gnu_debuglink and/or
236               .gnu_debugaltlink sections.  Also displays any links to
237               separate dwarf object files (dwo), if they are specified by the
238               DW_AT_GNU_dwo_name or DW_AT_dwo_name attributes in the
239               .debug_info section.
240
241           "K"
242           "=follow-links"
243               Display the contents of any selected debug sections that are
244               found in linked, separate debug info file(s).  This can result
245               in multiple versions of the same debug section being displayed
246               if it exists in more than one file.
247
248               In addition, when displaying DWARF attributes, if a form is
249               found that references the separate debug info file, then the
250               referenced contents will also be displayed.
251
252           "l"
253           "=rawline"
254               Displays the contents of the .debug_line section in a raw
255               format.
256
257           "L"
258           "=decodedline"
259               Displays the interpreted contents of the .debug_line section.
260
261           "m"
262           "=macro"
263               Displays the contents of the .debug_macro and/or .debug_macinfo
264               sections.
265
266           "o"
267           "=loc"
268               Displays the contents of the .debug_loc and/or .debug_loclists
269               sections.
270
271           "p"
272           "=pubnames"
273               Displays the contents of the .debug_pubnames and/or
274               .debug_gnu_pubnames sections.
275
276           "r"
277           "=aranges"
278               Displays the contents of the .debug_aranges section.
279
280           "R"
281           "=Ranges"
282               Displays the contents of the .debug_ranges and/or
283               .debug_rnglists sections.
284
285           "s"
286           "=str"
287               Displays the contents of the .debug_str, .debug_line_str and/or
288               .debug_str_offsets sections.
289
290           "t"
291           "=pubtype"
292               Displays the contents of the .debug_pubtypes and/or
293               .debug_gnu_pubtypes sections.
294
295           "T"
296           "=trace_aranges"
297               Displays the contents of the .trace_aranges section.
298
299           "u"
300           "=trace_abbrev"
301               Displays the contents of the .trace_abbrev section.
302
303           "U"
304           "=trace_info"
305               Displays the contents of the .trace_info section.
306
307           Note: displaying the contents of .debug_static_funcs,
308           .debug_static_vars and debug_weaknames sections is not currently
309           supported.
310
311       --dwarf-depth=n
312           Limit the dump of the ".debug_info" section to n children.  This is
313           only useful with --debug-dump=info.  The default is to print all
314           DIEs; the special value 0 for n will also have this effect.
315
316           With a non-zero value for n, DIEs at or deeper than n levels will
317           not be printed.  The range for n is zero-based.
318
319       --dwarf-start=n
320           Print only DIEs beginning with the DIE numbered n.  This is only
321           useful with --debug-dump=info.
322
323           If specified, this option will suppress printing of any header
324           information and all DIEs before the DIE numbered n.  Only siblings
325           and children of the specified DIE will be printed.
326
327           This can be used in conjunction with --dwarf-depth.
328
329       --ctf=section
330           Display the contents of the specified CTF section.  CTF sections
331           themselves contain many subsections, all of which are displayed in
332           order.
333
334       --ctf-parent=section
335           Specify the name of another section from which the CTF dictionary
336           can inherit types.  (If none is specified, we assume the CTF
337           dictionary inherits types from the default-named member of the
338           archive contained within this section.)
339
340       --ctf-symbols=section
341       --ctf-strings=section
342           Specify the name of another section from which the CTF file can
343           inherit strings and symbols.  By default, the ".symtab" and its
344           linked string table are used.
345
346           If either of --ctf-symbols or --ctf-strings is specified, the other
347           must be specified as well.
348
349       -I
350       --histogram
351           Display a histogram of bucket list lengths when displaying the
352           contents of the symbol tables.
353
354       -v
355       --version
356           Display the version number of readelf.
357
358       -W
359       --wide
360           Don't break output lines to fit into 80 columns. By default readelf
361           breaks section header and segment listing lines for 64-bit ELF
362           files, so that they fit into 80 columns. This option causes readelf
363           to print each section header resp. each segment one a single line,
364           which is far more readable on terminals wider than 80 columns.
365
366       -H
367       --help
368           Display the command-line options understood by readelf.
369
370       @file
371           Read command-line options from file.  The options read are inserted
372           in place of the original @file option.  If file does not exist, or
373           cannot be read, then the option will be treated literally, and not
374           removed.
375
376           Options in file are separated by whitespace.  A whitespace
377           character may be included in an option by surrounding the entire
378           option in either single or double quotes.  Any character (including
379           a backslash) may be included by prefixing the character to be
380           included with a backslash.  The file may itself contain additional
381           @file options; any such options will be processed recursively.
382

SEE ALSO

384       objdump(1), and the Info entries for binutils.
385
387       Copyright (c) 1991-2020 Free Software Foundation, Inc.
388
389       Permission is granted to copy, distribute and/or modify this document
390       under the terms of the GNU Free Documentation License, Version 1.3 or
391       any later version published by the Free Software Foundation; with no
392       Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
393       Texts.  A copy of the license is included in the section entitled "GNU
394       Free Documentation License".
395
396
397
398binutils-2.34                     2021-01-28                        READELF(1)
Impressum