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