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.\" 27f161abf9SEd Maste.Dd September 17, 2021 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 46*deef4b8cSEd Maste.Op Fl u | Fl -unwind 472c23cb7cSEd Maste.Op Fl v | Fl -version 482c23cb7cSEd Maste.Oo 492c23cb7cSEd Maste.Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc | 502c23cb7cSEd Maste.Fl -debug-dump Ns Op Ns = Ns Ar long-option-name , Ns ... 512c23cb7cSEd Maste.Oc 52b6d812d2SEd Maste.Op Fl x Ar section | Fl -hex-dump Ns = Ns Ar section 53e128bd0fSEd Maste.Op Fl z | Fl -decompress 542c23cb7cSEd Maste.Op Fl A | Fl -arch-specific 552c23cb7cSEd Maste.Op Fl D | Fl -use-dynamic 562c23cb7cSEd Maste.Op Fl H | Fl -help 572c23cb7cSEd Maste.Op Fl I | Fl -histogram 582c23cb7cSEd Maste.Op Fl N | -full-section-name 592c23cb7cSEd Maste.Op Fl S | Fl -sections | Fl -section-headers 602c23cb7cSEd Maste.Op Fl V | Fl -version-info 612c23cb7cSEd Maste.Op Fl W | Fl -wide 622c23cb7cSEd Maste.Ar file... 632c23cb7cSEd Maste.Sh DESCRIPTION 642c23cb7cSEd MasteThe 652c23cb7cSEd Maste.Nm 662c23cb7cSEd Masteutility displays information about ELF objects and 672c23cb7cSEd Maste.Xr ar 1 682c23cb7cSEd Mastearchives. 692c23cb7cSEd Maste.Pp 702c23cb7cSEd MasteThe 712c23cb7cSEd Maste.Nm 722c23cb7cSEd Masteutility recognizes the following options: 732c23cb7cSEd Maste.Bl -tag -width indent 742c23cb7cSEd Maste.It Fl a | Fl -all 752c23cb7cSEd MasteTurn on the following flags: 762c23cb7cSEd Maste.Fl d , 772c23cb7cSEd Maste.Fl h , 782c23cb7cSEd Maste.Fl I , 792c23cb7cSEd Maste.Fl l , 80f161abf9SEd Maste.Fl n , 812c23cb7cSEd Maste.Fl r , 822c23cb7cSEd Maste.Fl s , 83f161abf9SEd Maste.Fl u , 842c23cb7cSEd Maste.Fl A , 852c23cb7cSEd Maste.Fl S 862c23cb7cSEd Masteand 872c23cb7cSEd Maste.Fl V . 882c23cb7cSEd Maste.It Fl c | Fl -archive-index 892c23cb7cSEd MastePrint the archive symbol table for archives. 902c23cb7cSEd Maste.It Fl d | Fl -dynamic 912c23cb7cSEd MastePrint the contents of the 922c23cb7cSEd Maste.Li SHT_DYNAMIC 932c23cb7cSEd Mastesections in the ELF object. 942c23cb7cSEd Maste.It Fl e | Fl -headers 952c23cb7cSEd MastePrint all program, file and section headers in the ELF object. 962c23cb7cSEd Maste.It Fl g | Fl -section-groups 973ef90571SEd MastePrint the contents of the section groups in the ELF object. 982c23cb7cSEd Maste.It Fl h | Fl -file-header 992c23cb7cSEd MastePrint the file header of the ELF object. 1002c23cb7cSEd Maste.It Fl l | Fl -program-headers 1012c23cb7cSEd MastePrint the content of the program header table for the object. 1022c23cb7cSEd Maste.It Fl n | Fl -notes 1032c23cb7cSEd MastePrint the contents of 1042c23cb7cSEd Maste.Li PT_NOTE 1052c23cb7cSEd Mastesegments or 1062c23cb7cSEd Maste.Li SHT_NOTE 1072c23cb7cSEd Mastesections present in the ELF object. 1082c23cb7cSEd Maste.It Fl p Ar section | Fl -string-dump Ns = Ns Ar section 1092c23cb7cSEd MastePrint the contents of the specified section as printable strings. 1102c23cb7cSEd MasteThe argument 1112c23cb7cSEd Maste.Ar section 1122c23cb7cSEd Masteshould be the name of a section or a numeric section index. 1132c23cb7cSEd Maste.It Fl r | Fl -relocs 1142c23cb7cSEd MastePrint relocation information. 1152c23cb7cSEd Maste.It Fl s | Fl -syms | Fl -symbols 1162c23cb7cSEd MastePrint symbol tables. 1172c23cb7cSEd Maste.It Fl t | Fl -section-details 1182c23cb7cSEd MastePrint additional information about sections, such as the flags 1192c23cb7cSEd Mastefields in section headers. 120718699beSMark JohnstonImplies 121718699beSMark Johnston.Fl S . 122*deef4b8cSEd Maste.It Fl u | Fl -unwind 123*deef4b8cSEd MasteNot yet implemented (option accepted but ignored). 1242c23cb7cSEd Maste.It Fl v | Fl -version 1252c23cb7cSEd MastePrints a version identifier for 1262c23cb7cSEd Maste.Nm 1272c23cb7cSEd Masteand exits. 1282c23cb7cSEd Maste.It Fl w Ns Oo afilmoprsFLR Oc | Xo 1292c23cb7cSEd Maste.Fl -debug-dump Ns Op Ns = Ns Ar long-option-name , Ns ... 1302c23cb7cSEd Maste.Xc 1312c23cb7cSEd MasteDisplay DWARF information. 1322c23cb7cSEd MasteThe 1332c23cb7cSEd Maste.Fl w 1342c23cb7cSEd Masteoption is used with the short options in the following 1352c23cb7cSEd Mastetable; the 1362c23cb7cSEd Maste.Fl -debug-dump 1372c23cb7cSEd Masteoption is used with a comma-separated list of the corresponding long 1382c23cb7cSEd Masteoption names: 1392c23cb7cSEd Maste.Bl -column ".Em Short Option" "aranges|ranges" 1402c23cb7cSEd Maste.It Em Short Option Ta Em Long Option Ta Em Description 1412c23cb7cSEd Maste.It a Ta abbrev Ta Show abbreviation information. 1422c23cb7cSEd Maste.It f Ta frames Ta Show frame information, displaying frame instructions. 1432c23cb7cSEd Maste.It i Ta info Ta Show debugging information entries. 1442c23cb7cSEd Maste.It l Ta rawline Ta Show line information in raw form. 1452c23cb7cSEd Maste.It m Ta macro Ta Show macro information. 1462c23cb7cSEd Maste.It o Ta loc Ta Show location list information. 1472c23cb7cSEd Maste.It p Ta pubnames Ta Show global names. 1482c23cb7cSEd Maste.It r Ta aranges|ranges Ta Show address range information. 1492c23cb7cSEd Maste.It s Ta str Ta Show the debug string table. 150cf781b2eSEd Maste.It F Ta frames-interp Ta Show frame information, displaying register rules. 1512c23cb7cSEd Maste.It L Ta decodedline Ta Show line information in decoded form. 1522c23cb7cSEd Maste.It R Ta Ranges Ta Show range lists. 1532c23cb7cSEd Maste.El 1542c23cb7cSEd Maste.Pp 1552c23cb7cSEd MasteIf no sub-options are specified, the default is to show information 1562c23cb7cSEd Mastecorresponding to the 1572c23cb7cSEd Maste.Ar a , f , i, l , o , p , r , s 1582c23cb7cSEd Masteand 1592c23cb7cSEd Maste.Ar R 1602c23cb7cSEd Masteshort options. 1612c23cb7cSEd Maste.It Fl x Ar section | Fl -hex-dump Ns = Ns Ar section 1622c23cb7cSEd MasteDisplay the contents of the specified section in hexadecimal. 1632c23cb7cSEd MasteThe argument 1642c23cb7cSEd Maste.Ar section 1652c23cb7cSEd Masteshould be the name of a section or a numeric section index. 166e128bd0fSEd Maste.It Fl z | Fl -decompress 167e128bd0fSEd MasteDecompress contents of sections specified by 168e128bd0fSEd Maste.Fl x 169e128bd0fSEd Masteor 170e128bd0fSEd Maste.Fl p 171e128bd0fSEd Mastebefore displaying. 172e128bd0fSEd MasteIf the specified section is not compressed, it is displayed as is. 1732c23cb7cSEd Maste.It Fl A | Fl -arch-specific 1742c23cb7cSEd MasteThis option is accepted but is currently unimplemented. 1752c23cb7cSEd Maste.It Fl D | Fl -use-dynamic 1762c23cb7cSEd MastePrint the symbol table specified by the 1772c23cb7cSEd Maste.Li DT_SYMTAB 1782c23cb7cSEd Masteentry in the 1792c23cb7cSEd Maste.Dq Li .dynamic 1802c23cb7cSEd Mastesection. 1812c23cb7cSEd Maste.It Fl H | Fl -help 1822c23cb7cSEd MastePrint a help message. 1832c23cb7cSEd Maste.It Fl I | Fl -histogram 1842c23cb7cSEd MastePrint information on bucket list lengths for sections of type 1852c23cb7cSEd Maste.Li SHT_HASH 1862c23cb7cSEd Masteand 1872c23cb7cSEd Maste.Li SHT_GNU_HASH . 1882c23cb7cSEd Maste.It Fl N | Fl -full-section-name 1892c23cb7cSEd MasteThis option is accepted but is currently unimplemented. 1902c23cb7cSEd Maste.It Fl S | Fl -sections | Fl -section-headers 1912c23cb7cSEd MastePrint information in the section headers for each ELF object. 1922c23cb7cSEd Maste.It Fl V | Fl -version-info 1932c23cb7cSEd MastePrint symbol versioning information. 1942c23cb7cSEd Maste.It Fl W | Fl -wide 1952c23cb7cSEd MastePrint information about ELF structures using one long line per 1962c23cb7cSEd Mastestructure. 1972c23cb7cSEd MasteIf this option is not specified, 1982c23cb7cSEd Maste.Nm 1992c23cb7cSEd Mastewill list information in the headers of 64 bit ELF objects on two 2002c23cb7cSEd Masteseparate lines. 2012c23cb7cSEd Maste.El 2022c23cb7cSEd Maste.Sh EXIT STATUS 2032c23cb7cSEd Maste.Ex -std 2042c23cb7cSEd Maste.Sh SEE ALSO 2052c23cb7cSEd Maste.Xr nm 1 , 2062c23cb7cSEd Maste.Xr addr2line 1 , 2072c23cb7cSEd Maste.Xr elfcopy 1 , 2082c23cb7cSEd Maste.Sh AUTHORS 2092c23cb7cSEd MasteThe 2102c23cb7cSEd Maste.Nm 2112c23cb7cSEd Masteutility was written by 212b00fe64fSEd Maste.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net . 213