xref: /freebsd/contrib/elftoolchain/readelf/readelf.1 (revision e128bd0ff979799b32ae926c3264f11804ab0977)
12c23cb7cSEd Maste.\" Copyright (c) 2009,2011 Joseph Koshy <jkoshy@users.sourceforge.net>
22c23cb7cSEd Maste.\" All rights reserved.
32c23cb7cSEd Maste.\"
42c23cb7cSEd Maste.\" Redistribution and use in source and binary forms, with or without
52c23cb7cSEd Maste.\" modification, are permitted provided that the following conditions
62c23cb7cSEd Maste.\" are met:
72c23cb7cSEd Maste.\" 1. Redistributions of source code must retain the above copyright
82c23cb7cSEd Maste.\"    notice, this list of conditions and the following disclaimer
92c23cb7cSEd Maste.\"    in this position and unchanged.
102c23cb7cSEd Maste.\" 2. Redistributions in binary form must reproduce the above copyright
112c23cb7cSEd Maste.\"    notice, this list of conditions and the following disclaimer in the
122c23cb7cSEd Maste.\"    documentation and/or other materials provided with the distribution.
132c23cb7cSEd Maste.\"
142c23cb7cSEd Maste.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
152c23cb7cSEd Maste.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
162c23cb7cSEd Maste.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
172c23cb7cSEd Maste.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
182c23cb7cSEd Maste.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
192c23cb7cSEd Maste.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
202c23cb7cSEd Maste.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
212c23cb7cSEd Maste.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
222c23cb7cSEd Maste.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
232c23cb7cSEd Maste.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
242c23cb7cSEd Maste.\"
25d003e0d7SEd Maste.\" $Id: readelf.1 3753 2019-06-28 01:13:13Z emaste $
262c23cb7cSEd Maste.\"
27*e128bd0fSEd Maste.Dd October 31, 2020
282c23cb7cSEd Maste.Dt READELF 1
29ae500c1fSEd Maste.Os
302c23cb7cSEd Maste.Sh NAME
312c23cb7cSEd Maste.Nm readelf
322c23cb7cSEd Maste.Nd display information about ELF objects
332c23cb7cSEd Maste.Sh SYNOPSIS
342c23cb7cSEd Maste.Nm
352c23cb7cSEd Maste.Op Fl a | Fl -all
362c23cb7cSEd Maste.Op Fl c | Fl -archive-index
372c23cb7cSEd Maste.Op Fl d | Fl -dynamic
382c23cb7cSEd Maste.Op Fl e | Fl -headers
392c23cb7cSEd Maste.Op Fl g | Fl -section-groups
402c23cb7cSEd Maste.Op Fl h | Fl -file-header
412c23cb7cSEd Maste.Op Fl l | Fl -program-headers
422c23cb7cSEd Maste.Op Fl n | Fl -notes
432c23cb7cSEd Maste.Op Fl p Ar section | Fl -string-dump Ns = Ns Ar section
442c23cb7cSEd Maste.Op Fl r | Fl -relocs
452c23cb7cSEd Maste.Op Fl t | Fl -section-details
462c23cb7cSEd Maste.Op Fl v | Fl -version
472c23cb7cSEd Maste.Oo
482c23cb7cSEd Maste.Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc |
492c23cb7cSEd Maste.Fl -debug-dump Ns Op Ns = Ns Ar long-option-name , Ns ...
502c23cb7cSEd Maste.Oc
51b6d812d2SEd Maste.Op Fl x Ar section | Fl -hex-dump Ns = Ns Ar section
52*e128bd0fSEd Maste.Op Fl z | Fl -decompress
532c23cb7cSEd Maste.Op Fl A | Fl -arch-specific
542c23cb7cSEd Maste.Op Fl D | Fl -use-dynamic
552c23cb7cSEd Maste.Op Fl H | Fl -help
562c23cb7cSEd Maste.Op Fl I | Fl -histogram
572c23cb7cSEd Maste.Op Fl N | -full-section-name
582c23cb7cSEd Maste.Op Fl S | Fl -sections | Fl -section-headers
592c23cb7cSEd Maste.Op Fl V | Fl -version-info
602c23cb7cSEd Maste.Op Fl W | Fl -wide
612c23cb7cSEd Maste.Ar file...
622c23cb7cSEd Maste.Sh DESCRIPTION
632c23cb7cSEd MasteThe
642c23cb7cSEd Maste.Nm
652c23cb7cSEd Masteutility displays information about ELF objects and
662c23cb7cSEd Maste.Xr ar 1
672c23cb7cSEd Mastearchives.
682c23cb7cSEd Maste.Pp
692c23cb7cSEd MasteThe
702c23cb7cSEd Maste.Nm
712c23cb7cSEd Masteutility recognizes the following options:
722c23cb7cSEd Maste.Bl -tag -width indent
732c23cb7cSEd Maste.It Fl a | Fl -all
742c23cb7cSEd MasteTurn on the following flags:
752c23cb7cSEd Maste.Fl d ,
762c23cb7cSEd Maste.Fl h ,
772c23cb7cSEd Maste.Fl I ,
782c23cb7cSEd Maste.Fl l ,
792c23cb7cSEd Maste.Fl r ,
802c23cb7cSEd Maste.Fl s ,
812c23cb7cSEd Maste.Fl A ,
822c23cb7cSEd Maste.Fl S
832c23cb7cSEd Masteand
842c23cb7cSEd Maste.Fl V .
852c23cb7cSEd Maste.It Fl c | Fl -archive-index
862c23cb7cSEd MastePrint the archive symbol table for archives.
872c23cb7cSEd Maste.It Fl d | Fl -dynamic
882c23cb7cSEd MastePrint the contents of the
892c23cb7cSEd Maste.Li SHT_DYNAMIC
902c23cb7cSEd Mastesections in the ELF object.
912c23cb7cSEd Maste.It Fl e | Fl -headers
922c23cb7cSEd MastePrint all program, file and section headers in the ELF object.
932c23cb7cSEd Maste.It Fl g | Fl -section-groups
943ef90571SEd MastePrint the contents of the section groups in the ELF object.
952c23cb7cSEd Maste.It Fl h | Fl -file-header
962c23cb7cSEd MastePrint the file header of the ELF object.
972c23cb7cSEd Maste.It Fl l | Fl -program-headers
982c23cb7cSEd MastePrint the content of the program header table for the object.
992c23cb7cSEd Maste.It Fl n | Fl -notes
1002c23cb7cSEd MastePrint the contents of
1012c23cb7cSEd Maste.Li PT_NOTE
1022c23cb7cSEd Mastesegments or
1032c23cb7cSEd Maste.Li SHT_NOTE
1042c23cb7cSEd Mastesections present in the ELF object.
1052c23cb7cSEd Maste.It Fl p Ar section | Fl -string-dump Ns = Ns Ar section
1062c23cb7cSEd MastePrint the contents of the specified section as printable strings.
1072c23cb7cSEd MasteThe argument
1082c23cb7cSEd Maste.Ar section
1092c23cb7cSEd Masteshould be the name of a section or a numeric section index.
1102c23cb7cSEd Maste.It Fl r | Fl -relocs
1112c23cb7cSEd MastePrint relocation information.
1122c23cb7cSEd Maste.It Fl s | Fl -syms | Fl -symbols
1132c23cb7cSEd MastePrint symbol tables.
1142c23cb7cSEd Maste.It Fl t | Fl -section-details
1152c23cb7cSEd MastePrint additional information about sections, such as the flags
1162c23cb7cSEd Mastefields in section headers.
117718699beSMark JohnstonImplies
118718699beSMark Johnston.Fl S .
1192c23cb7cSEd Maste.It Fl v | Fl -version
1202c23cb7cSEd MastePrints a version identifier for
1212c23cb7cSEd Maste.Nm
1222c23cb7cSEd Masteand exits.
1232c23cb7cSEd Maste.It Fl w Ns Oo afilmoprsFLR Oc | Xo
1242c23cb7cSEd Maste.Fl -debug-dump Ns Op Ns = Ns Ar long-option-name , Ns ...
1252c23cb7cSEd Maste.Xc
1262c23cb7cSEd MasteDisplay DWARF information.
1272c23cb7cSEd MasteThe
1282c23cb7cSEd Maste.Fl w
1292c23cb7cSEd Masteoption is used with the short options in the following
1302c23cb7cSEd Mastetable; the
1312c23cb7cSEd Maste.Fl -debug-dump
1322c23cb7cSEd Masteoption is used with a comma-separated list of the corresponding long
1332c23cb7cSEd Masteoption names:
1342c23cb7cSEd Maste.Bl -column ".Em Short Option" "aranges|ranges"
1352c23cb7cSEd Maste.It Em Short Option Ta Em Long Option Ta Em Description
1362c23cb7cSEd Maste.It a Ta abbrev Ta Show abbreviation information.
1372c23cb7cSEd Maste.It f Ta frames Ta Show frame information, displaying frame instructions.
1382c23cb7cSEd Maste.It i Ta info Ta Show debugging information entries.
1392c23cb7cSEd Maste.It l Ta rawline Ta Show line information in raw form.
1402c23cb7cSEd Maste.It m Ta macro Ta Show macro information.
1412c23cb7cSEd Maste.It o Ta loc Ta Show location list information.
1422c23cb7cSEd Maste.It p Ta pubnames Ta Show global names.
1432c23cb7cSEd Maste.It r Ta aranges|ranges Ta Show address range information.
1442c23cb7cSEd Maste.It s Ta str Ta Show the debug string table.
145cf781b2eSEd Maste.It F Ta frames-interp Ta Show frame information, displaying register rules.
1462c23cb7cSEd Maste.It L Ta decodedline Ta Show line information in decoded form.
1472c23cb7cSEd Maste.It R Ta Ranges Ta Show range lists.
1482c23cb7cSEd Maste.El
1492c23cb7cSEd Maste.Pp
1502c23cb7cSEd MasteIf no sub-options are specified, the default is to show information
1512c23cb7cSEd Mastecorresponding to the
1522c23cb7cSEd Maste.Ar a , f , i, l , o , p , r , s
1532c23cb7cSEd Masteand
1542c23cb7cSEd Maste.Ar R
1552c23cb7cSEd Masteshort options.
1562c23cb7cSEd Maste.It Fl x Ar section | Fl -hex-dump Ns = Ns Ar section
1572c23cb7cSEd MasteDisplay the contents of the specified section in hexadecimal.
1582c23cb7cSEd MasteThe argument
1592c23cb7cSEd Maste.Ar section
1602c23cb7cSEd Masteshould be the name of a section or a numeric section index.
161*e128bd0fSEd Maste.It Fl z | Fl -decompress
162*e128bd0fSEd MasteDecompress contents of sections specified by
163*e128bd0fSEd Maste.Fl x
164*e128bd0fSEd Masteor
165*e128bd0fSEd Maste.Fl p
166*e128bd0fSEd Mastebefore displaying.
167*e128bd0fSEd MasteIf the specified section is not compressed, it is displayed as is.
1682c23cb7cSEd Maste.It Fl A | Fl -arch-specific
1692c23cb7cSEd MasteThis option is accepted but is currently unimplemented.
1702c23cb7cSEd Maste.It Fl D | Fl -use-dynamic
1712c23cb7cSEd MastePrint the symbol table specified by the
1722c23cb7cSEd Maste.Li DT_SYMTAB
1732c23cb7cSEd Masteentry in the
1742c23cb7cSEd Maste.Dq Li .dynamic
1752c23cb7cSEd Mastesection.
1762c23cb7cSEd Maste.It Fl H | Fl -help
1772c23cb7cSEd MastePrint a help message.
1782c23cb7cSEd Maste.It Fl I | Fl -histogram
1792c23cb7cSEd MastePrint information on bucket list lengths for sections of type
1802c23cb7cSEd Maste.Li SHT_HASH
1812c23cb7cSEd Masteand
1822c23cb7cSEd Maste.Li SHT_GNU_HASH .
1832c23cb7cSEd Maste.It Fl N | Fl -full-section-name
1842c23cb7cSEd MasteThis option is accepted but is currently unimplemented.
1852c23cb7cSEd Maste.It Fl S | Fl -sections | Fl -section-headers
1862c23cb7cSEd MastePrint information in the section headers for each ELF object.
1872c23cb7cSEd Maste.It Fl V | Fl -version-info
1882c23cb7cSEd MastePrint symbol versioning information.
1892c23cb7cSEd Maste.It Fl W | Fl -wide
1902c23cb7cSEd MastePrint information about ELF structures using one long line per
1912c23cb7cSEd Mastestructure.
1922c23cb7cSEd MasteIf this option is not specified,
1932c23cb7cSEd Maste.Nm
1942c23cb7cSEd Mastewill list information in the headers of 64 bit ELF objects on two
1952c23cb7cSEd Masteseparate lines.
1962c23cb7cSEd Maste.El
1972c23cb7cSEd Maste.Sh EXIT STATUS
1982c23cb7cSEd Maste.Ex -std
1992c23cb7cSEd Maste.Sh SEE ALSO
2002c23cb7cSEd Maste.Xr nm 1 ,
2012c23cb7cSEd Maste.Xr addr2line 1 ,
2022c23cb7cSEd Maste.Xr elfcopy 1 ,
2032c23cb7cSEd Maste.Sh AUTHORS
2042c23cb7cSEd MasteThe
2052c23cb7cSEd Maste.Nm
2062c23cb7cSEd Masteutility was written by
207b00fe64fSEd Maste.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .
208