Linux "readelf" Command Line Options and Examples
Displays information about ELF files.

readelf displays information about one or more ELF format object files. The options control what particular information to display. elffile.


Usage:

readelf [-a|--all]
[-h|--file-header]
[-l|--program-headers|--segments]
[-S|--section-headers|--sections]
[-g|--section-groups]
[-t|--section-details]
[-e|--headers]
[-s|--syms|--symbols]
[--dyn-syms]
[-n|--notes]
[-r|--relocs]
[-u|--unwind]
[-d|--dynamic]
[-V|--version-info]
[-A|--arch-specific]
[-D|--use-dynamic]
[-x |--hex-dump=]
[-p |--string-dump=]
[-R |--relocated-dump=]
[-z|--decompress]
[-c|--archive-index]
[-w[lLiaprmfFsoRtUuTgAckK]|
--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]]
[--dwarf-depth=n]
[--dwarf-start=n]
[-I|--histogram]
[-v|--version]
[-W|--wide]
[-H|--help]
elffile...




Command Line Options:

-v
or -H must be given.
readelf -v ...
--all
Equivalent to specifying --file-header, --program-headers, --sections, --symbols, --relocs, --dynamic,
readelf --all ...
--notes
Note - this option does not enable --use-dynamic itself, so if that option is not present on the commandline then dynamic symbols and dynamic relocs will not be displayed.
readelf --notes ...
--file-header
Displays the information contained in the ELF header at the start of the file.
readelf --file-header ...
--segments
Displays the information contained in the file's segment headers, if it has any.
readelf --segments ...
--section-headers
Displays the information contained in the file's section headers, if it has any.
readelf --section-headers ...
--section-groups
Displays the information contained in the file's section groups, if it has any.
readelf --section-groups ...
--section-details
Displays the detailed section information. Implies -S.
readelf --section-details ...
--syms
Displays the entries in symbol table section of the file, if it has one. If a symbol has versioninformation associated with it then this is displayed as well. The version string is displayed as asuffix to the symbol name, preceeded by an @ character. For example foo@VER_1. If the version is thedefault version to be used when resolving unversioned references to the symbol then it is displayed as asuffix preceeded by two @ characters. For example foo@@VER_2.
readelf --syms ...
--dyn-syms
Displays the entries in dynamic symbol table section of the file, if it has one. The output format is thesame as the format used by the --syms option.
readelf --dyn-syms ...
--headers
Display all the headers in the file. Equivalent to -h -l -S.
readelf --headers ...
--relocs
Displays the contents of the file's relocation section, if it has one.
readelf --relocs ...
--unwind
Displays the contents of the file's unwind section, if it has one. Only the unwind sections for IA64 ELFfiles, as well as ARM unwind tables (".ARM.exidx" / ".ARM.extab") are currently supported.
readelf --unwind ...
--dynamic
Displays the contents of the file's dynamic section, if it has one.
readelf --dynamic ...
--version-info
Displays the contents of the version sections in the file, it they exist.
readelf --version-info ...
--arch-specific
Displays architecture-specific information in the file, if there is any.
readelf --arch-specific ...
--use-dynamic
When displaying symbols, this option makes readelf use the symbol hash tables in the file's dynamicsection, rather than the symbol table sections.When displaying relocations, this option makes readelf display the dynamic relocations rather than thestatic relocations.
readelf --use-dynamic ...
-x
<number or name>
readelf -x ...
--hex-dump=<number
Displays the contents of the indicated section as a hexadecimal bytes. A number identifies a particularsection by index in the section table; any other string identifies all sections with that name in theobject file.
readelf --hex-dump=<number ...
-R
<number or name>
readelf -R ...
--relocated-dump=<number
Displays the contents of the indicated section as a hexadecimal bytes. A number identifies a particularsection by index in the section table; any other string identifies all sections with that name in theobject file. The contents of the section will be relocated before they are displayed.
readelf --relocated-dump=<number ...
-p
<number or name>
readelf -p ...
--string-dump=<number
Displays the contents of the indicated section as printable strings. A number identifies a particularsection by index in the section table; any other string identifies all sections with that name in theobject file.
readelf --string-dump=<number ...
--decompress
Requests that the section(s) being dumped by x, R or p options are decompressed before being displayed.If the section(s) are not compressed then they are displayed as is.
readelf --decompress ...
--archive-index
Displays the file symbol index information contained in the header part of binary archives. Performs thesame function as the t command to ar, but without using the BFD library.
readelf --archive-index ...
--dwarf-depth
Limit the dump of the ".debug_info" section to n children. This is only useful with --debug-dump=info.The default is to print all DIEs; the special value 0 for n will also have this effect.With a non-zero value for n, DIEs at or deeper than n levels will not be printed. The range for n iszero-based.
readelf --dwarf-depth ...
--dwarf-start
Print only DIEs beginning with the DIE numbered n. This is only useful with --debug-dump=info.If specified, this option will suppress printing of any header information and all DIEs before the DIEnumbered n. Only siblings and children of the specified DIE will be printed.This can be used in conjunction with --dwarf-depth.
readelf --dwarf-start ...
--histogram
Display a histogram of bucket list lengths when displaying the contents of the symbol tables.
readelf --histogram ...
--version
Display the version number of readelf.
readelf --version ...
--wide
Don't break output lines to fit into 80 columns. By default readelf breaks section header and segmentlisting lines for 64-bit ELF files, so that they fit into 80 columns. This option causes readelf to printeach section header resp. each segment one a single line, which is far more readable on terminals widerthan 80 columns.
readelf --wide ...
--help
Display the command line options understood by readelf.@fileRead command-line options from file. The options read are inserted in place of the original @file option.If file does not exist, or cannot be read, then the option will be treated literally, and not removed.Options in file are separated by whitespace. A whitespace character may be included in an option bysurrounding the entire option in either single or double quotes. Any character (including a backslash)may be included by prefixing the character to be included with a backslash. The file may itself containadditional @file options; any such options will be processed recursively.
readelf --help ...