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|--lto-syms]
18               [--sym-base=[0|8|10|16]]
19               [--demangle=style|--no-demangle]
20               [--quiet]
21               [--recurse-limit|--no-recurse-limit]
22               [-U method|--unicode=method]
23               [-n|--notes]
24               [-r|--relocs]
25               [-u|--unwind]
26               [-d|--dynamic]
27               [-V|--version-info]
28               [-A|--arch-specific]
29               [-D|--use-dynamic]
30               [-L|--lint|--enable-checks]
31               [-x <number or name>|--hex-dump=<number or name>]
32               [-p <number or name>|--string-dump=<number or name>]
33               [-R <number or name>|--relocated-dump=<number or name>]
34               [-z|--decompress]
35               [-c|--archive-index]
36               [-w[lLiaprmfFsoORtUuTgAck]|
37                --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]]
38               [-wK|--debug-dump=follow-links]
39               [-wN|--debug-dump=no-follow-links]
40               [-P|--process-links]
41               [--dwarf-depth=n]
42               [--dwarf-start=n]
43               [--ctf=section]
44               [--ctf-parent=section]
45               [--ctf-symbols=section]
46               [--ctf-strings=section]
47               [-I|--histogram]
48               [-v|--version]
49               [-W|--wide]
50               [-T|--silent-truncation]
51               [-H|--help]
52               elffile...
53

DESCRIPTION

55       readelf displays information about one or more ELF format object files.
56       The options control what particular information to display.
57
58       elffile... are the object files to be examined.  32-bit and 64-bit ELF
59       files are supported, as are archives containing ELF files.
60
61       This program performs a similar function to objdump but it goes into
62       more detail and it exists independently of the BFD library, so if there
63       is a bug in BFD then readelf will not be affected.
64

OPTIONS

66       The long and short forms of options, shown here as alternatives, are
67       equivalent.  At least one option besides -v or -H must be given.
68
69       -a
70       --all
71           Equivalent to specifying --file-header, --program-headers,
72           --sections, --symbols, --relocs, --dynamic, --notes,
73           --version-info, --arch-specific, --unwind, --section-groups and
74           --histogram.
75
76           Note - this option does not enable --use-dynamic itself, so if that
77           option is not present on the command line then dynamic symbols and
78           dynamic relocs will not be displayed.
79
80       -h
81       --file-header
82           Displays the information contained in the ELF header at the start
83           of the file.
84
85       -l
86       --program-headers
87       --segments
88           Displays the information contained in the file's segment headers,
89           if it has any.
90
91       --quiet
92           Suppress "no symbols" diagnostic.
93
94       -S
95       --sections
96       --section-headers
97           Displays the information contained in the file's section headers,
98           if it has any.
99
100       -g
101       --section-groups
102           Displays the information contained in the file's section groups, if
103           it has any.
104
105       -t
106       --section-details
107           Displays the detailed section information. Implies -S.
108
109       -s
110       --symbols
111       --syms
112           Displays the entries in symbol table section of the file, if it has
113           one.  If a symbol has version information associated with it then
114           this is displayed as well.  The version string is displayed as a
115           suffix to the symbol name, preceded by an @ character.  For example
116           foo@VER_1.  If the version is the default version to be used when
117           resolving unversioned references to the symbol then it is displayed
118           as a suffix preceded by two @ characters.  For example foo@@VER_2.
119
120       --dyn-syms
121           Displays the entries in dynamic symbol table section of the file,
122           if it has one.  The output format is the same as the format used by
123           the --syms option.
124
125       --lto-syms
126           Displays the contents of any LTO symbol tables in the file.
127
128       --sym-base=[0|8|10|16]
129           Forces the size field of the symbol table to use the given base.
130           Any unrecognized options will be treated as 0.  --sym-base=0
131           represents the default and legacy behaviour.  This will output
132           sizes as decimal for numbers less than 100000.  For sizes 100000
133           and greater hexadecimal notation will be used with a 0x prefix.
134           --sym-base=8 will give the symbol sizes in octal.  --sym-base=10
135           will always give the symbol sizes in decimal.  --sym-base=16 will
136           always give the symbol sizes in hexadecimal with a 0x prefix.
137
138       -C
139       --demangle[=style]
140           Decode (demangle) low-level symbol names into user-level names.
141           This makes C++ function names readable.  Different compilers have
142           different mangling styles.  The optional demangling style argument
143           can be used to choose an appropriate demangling style for your
144           compiler.
145
146       --no-demangle
147           Do not demangle low-level symbol names.  This is the default.
148
149       --recurse-limit
150       --no-recurse-limit
151       --recursion-limit
152       --no-recursion-limit
153           Enables or disables a limit on the amount of recursion performed
154           whilst demangling strings.  Since the name mangling formats allow
155           for an infinite level of recursion it is possible to create strings
156           whose decoding will exhaust the amount of stack space available on
157           the host machine, triggering a memory fault.  The limit tries to
158           prevent this from happening by restricting recursion to 2048 levels
159           of nesting.
160
161           The default is for this limit to be enabled, but disabling it may
162           be necessary in order to demangle truly complicated names.  Note
163           however that if the recursion limit is disabled then stack
164           exhaustion is possible and any bug reports about such an event will
165           be rejected.
166
167       -U [d|i|l|e|x|h]
168       --unicode=[default|invalid|locale|escape|hex|highlight]
169           Controls the display of non-ASCII characters in identifier names.
170           The default (--unicode=locale or --unicode=default) is to treat
171           them as multibyte characters and display them in the current
172           locale.  All other versions of this option treat the bytes as UTF-8
173           encoded values and attempt to interpret them.  If they cannot be
174           interpreted or if the --unicode=invalid option is used then they
175           are displayed as a sequence of hex bytes, encloses in curly
176           parethesis characters.
177
178           Using the --unicode=escape option will display the characters as as
179           unicode escape sequences (\uxxxx).  Using the --unicode=hex will
180           display the characters as hex byte sequences enclosed between angle
181           brackets.
182
183           Using the --unicode=highlight will display the characters as
184           unicode escape sequences but it will also highlighted them in red,
185           assuming that colouring is supported by the output device.  The
186           colouring is intended to draw attention to the presence of unicode
187           sequences when they might not be expected.
188
189       -e
190       --headers
191           Display all the headers in the file.  Equivalent to -h -l -S.
192
193       -n
194       --notes
195           Displays the contents of the NOTE segments and/or sections, if any.
196
197       -r
198       --relocs
199           Displays the contents of the file's relocation section, if it has
200           one.
201
202       -u
203       --unwind
204           Displays the contents of the file's unwind section, if it has one.
205           Only the unwind sections for IA64 ELF files, as well as ARM unwind
206           tables (".ARM.exidx" / ".ARM.extab") are currently supported.  If
207           support is not yet implemented for your architecture you could try
208           dumping the contents of the .eh_frames section using the
209           --debug-dump=frames or --debug-dump=frames-interp options.
210
211       -d
212       --dynamic
213           Displays the contents of the file's dynamic section, if it has one.
214
215       -V
216       --version-info
217           Displays the contents of the version sections in the file, it they
218           exist.
219
220       -A
221       --arch-specific
222           Displays architecture-specific information in the file, if there is
223           any.
224
225       -D
226       --use-dynamic
227           When displaying symbols, this option makes readelf use the symbol
228           hash tables in the file's dynamic section, rather than the symbol
229           table sections.
230
231           When displaying relocations, this option makes readelf display the
232           dynamic relocations rather than the static relocations.
233
234       -L
235       --lint
236       --enable-checks
237           Displays warning messages about possible problems with the file(s)
238           being examined.  If used on its own then all of the contents of the
239           file(s) will be examined.  If used with one of the dumping options
240           then the warning messages will only be produced for the things
241           being displayed.
242
243       -x <number or name>
244       --hex-dump=<number or name>
245           Displays the contents of the indicated section as a hexadecimal
246           bytes.  A number identifies a particular section by index in the
247           section table; any other string identifies all sections with that
248           name in the object file.
249
250       -R <number or name>
251       --relocated-dump=<number or name>
252           Displays the contents of the indicated section as a hexadecimal
253           bytes.  A number identifies a particular section by index in the
254           section table; any other string identifies all sections with that
255           name in the object file.  The contents of the section will be
256           relocated before they are displayed.
257
258       -p <number or name>
259       --string-dump=<number or name>
260           Displays the contents of the indicated section as printable
261           strings.  A number identifies a particular section by index in the
262           section table; any other string identifies all sections with that
263           name in the object file.
264
265       -z
266       --decompress
267           Requests that the section(s) being dumped by x, R or p options are
268           decompressed before being displayed.  If the section(s) are not
269           compressed then they are displayed as is.
270
271       -c
272       --archive-index
273           Displays the file symbol index information contained in the header
274           part of binary archives.  Performs the same function as the t
275           command to ar, but without using the BFD library.
276
277       -w[lLiaprmfFsOoRtUuTgAckK]
278       --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]
279           Displays the contents of the DWARF debug sections in the file, if
280           any are present.  Compressed debug sections are automatically
281           decompressed (temporarily) before they are displayed.  If one or
282           more of the optional letters or words follows the switch then only
283           those type(s) of data will be dumped.  The letters and words refer
284           to the following information:
285
286           "a"
287           "=abbrev"
288               Displays the contents of the .debug_abbrev section.
289
290           "A"
291           "=addr"
292               Displays the contents of the .debug_addr section.
293
294           "c"
295           "=cu_index"
296               Displays the contents of the .debug_cu_index and/or
297               .debug_tu_index sections.
298
299           "f"
300           "=frames"
301               Display the raw contents of a .debug_frame section.
302
303           "F"
304           "=frames-interp"
305               Display the interpreted contents of a .debug_frame section.
306
307           "g"
308           "=gdb_index"
309               Displays the contents of the .gdb_index and/or .debug_names
310               sections.
311
312           "i"
313           "=info"
314               Displays the contents of the .debug_info section.  Note: the
315               output from this option can also be restricted by the use of
316               the --dwarf-depth and --dwarf-start options.
317
318           "k"
319           "=links"
320               Displays the contents of the .gnu_debuglink, .gnu_debugaltlink
321               and .debug_sup sections, if any of them are present.  Also
322               displays any links to separate dwarf object files (dwo), if
323               they are specified by the DW_AT_GNU_dwo_name or DW_AT_dwo_name
324               attributes in the .debug_info section.
325
326           "K"
327           "=follow-links"
328               Display the contents of any selected debug sections that are
329               found in linked, separate debug info file(s).  This can result
330               in multiple versions of the same debug section being displayed
331               if it exists in more than one file.
332
333               In addition, when displaying DWARF attributes, if a form is
334               found that references the separate debug info file, then the
335               referenced contents will also be displayed.
336
337               Note - in some distributions this option is enabled by default.
338               It can be disabled via the N debug option.  The default can be
339               chosen when configuring the binutils via the
340               --enable-follow-debug-links=yes or
341               --enable-follow-debug-links=no options.  If these are not used
342               then the default is to enable the following of debug links.
343
344           "N"
345           "=no-follow-links"
346               Disables the following of links to separate debug info files.
347
348           "l"
349           "=rawline"
350               Displays the contents of the .debug_line section in a raw
351               format.
352
353           "L"
354           "=decodedline"
355               Displays the interpreted contents of the .debug_line section.
356
357           "m"
358           "=macro"
359               Displays the contents of the .debug_macro and/or .debug_macinfo
360               sections.
361
362           "o"
363           "=loc"
364               Displays the contents of the .debug_loc and/or .debug_loclists
365               sections.
366
367           "O"
368           "=str-offsets"
369               Displays the contents of the .debug_str_offsets section.
370
371           "p"
372           "=pubnames"
373               Displays the contents of the .debug_pubnames and/or
374               .debug_gnu_pubnames sections.
375
376           "r"
377           "=aranges"
378               Displays the contents of the .debug_aranges section.
379
380           "R"
381           "=Ranges"
382               Displays the contents of the .debug_ranges and/or
383               .debug_rnglists sections.
384
385           "s"
386           "=str"
387               Displays the contents of the .debug_str, .debug_line_str and/or
388               .debug_str_offsets sections.
389
390           "t"
391           "=pubtype"
392               Displays the contents of the .debug_pubtypes and/or
393               .debug_gnu_pubtypes sections.
394
395           "T"
396           "=trace_aranges"
397               Displays the contents of the .trace_aranges section.
398
399           "u"
400           "=trace_abbrev"
401               Displays the contents of the .trace_abbrev section.
402
403           "U"
404           "=trace_info"
405               Displays the contents of the .trace_info section.
406
407           Note: displaying the contents of .debug_static_funcs,
408           .debug_static_vars and debug_weaknames sections is not currently
409           supported.
410
411       --dwarf-depth=n
412           Limit the dump of the ".debug_info" section to n children.  This is
413           only useful with --debug-dump=info.  The default is to print all
414           DIEs; the special value 0 for n will also have this effect.
415
416           With a non-zero value for n, DIEs at or deeper than n levels will
417           not be printed.  The range for n is zero-based.
418
419       --dwarf-start=n
420           Print only DIEs beginning with the DIE numbered n.  This is only
421           useful with --debug-dump=info.
422
423           If specified, this option will suppress printing of any header
424           information and all DIEs before the DIE numbered n.  Only siblings
425           and children of the specified DIE will be printed.
426
427           This can be used in conjunction with --dwarf-depth.
428
429       -P
430       --process-links
431           Display the contents of non-debug sections found in separate
432           debuginfo files that are linked to the main file.  This option
433           automatically implies the -wK option, and only sections requested
434           by other command line options will be displayed.
435
436       --ctf[=section]
437           Display the contents of the specified CTF section.  CTF sections
438           themselves contain many subsections, all of which are displayed in
439           order.
440
441           By default, display the name of the section named .ctf, which is
442           the name emitted by ld.
443
444       --ctf-parent=member
445           If the CTF section contains ambiguously-defined types, it will
446           consist of an archive of many CTF dictionaries, all inheriting from
447           one dictionary containing unambiguous types.  This member is by
448           default named .ctf, like the section containing it, but it is
449           possible to change this name using the
450           "ctf_link_set_memb_name_changer" function at link time.  When
451           looking at CTF archives that have been created by a linker that
452           uses the name changer to rename the parent archive member,
453           --ctf-parent can be used to specify the name used for the parent.
454
455       --ctf-symbols=section
456       --ctf-strings=section
457           Specify the name of another section from which the CTF file can
458           inherit strings and symbols.  By default, the ".symtab" and its
459           linked string table are used.
460
461           If either of --ctf-symbols or --ctf-strings is specified, the other
462           must be specified as well.
463
464       -I
465       --histogram
466           Display a histogram of bucket list lengths when displaying the
467           contents of the symbol tables.
468
469       -v
470       --version
471           Display the version number of readelf.
472
473       -W
474       --wide
475           Don't break output lines to fit into 80 columns. By default readelf
476           breaks section header and segment listing lines for 64-bit ELF
477           files, so that they fit into 80 columns. This option causes readelf
478           to print each section header resp. each segment one a single line,
479           which is far more readable on terminals wider than 80 columns.
480
481       -T
482       --silent-truncation
483           Normally when readelf is displaying a symbol name, and it has to
484           truncate the name to fit into an 80 column display, it will add a
485           suffix of "[...]" to the name.  This command line option disables
486           this behaviour, allowing 5 more characters of the name to be
487           displayed and restoring the old behaviour of readelf (prior to
488           release 2.35).
489
490       -H
491       --help
492           Display the command-line options understood by readelf.
493
494       @file
495           Read command-line options from file.  The options read are inserted
496           in place of the original @file option.  If file does not exist, or
497           cannot be read, then the option will be treated literally, and not
498           removed.
499
500           Options in file are separated by whitespace.  A whitespace
501           character may be included in an option by surrounding the entire
502           option in either single or double quotes.  Any character (including
503           a backslash) may be included by prefixing the character to be
504           included with a backslash.  The file may itself contain additional
505           @file options; any such options will be processed recursively.
506

SEE ALSO

508       objdump(1), and the Info entries for binutils.
509
511       Copyright (c) 1991-2022 Free Software Foundation, Inc.
512
513       Permission is granted to copy, distribute and/or modify this document
514       under the terms of the GNU Free Documentation License, Version 1.3 or
515       any later version published by the Free Software Foundation; with no
516       Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
517       Texts.  A copy of the license is included in the section entitled "GNU
518       Free Documentation License".
519
520
521
522binutils-2.38                     2022-07-20                        READELF(1)
Impressum