]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/elftoolchain/readelf/readelf.1
Merge ^/head r337286 through r337585.
[FreeBSD/FreeBSD.git] / contrib / elftoolchain / readelf / readelf.1
1 .\" Copyright (c) 2009,2011 Joseph Koshy <jkoshy@users.sourceforge.net>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer
9 .\"    in this position and unchanged.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" $Id: readelf.1 3486 2016-08-22 14:10:05Z emaste $
26 .\"
27 .Dd September 13, 2012
28 .Os
29 .Dt READELF 1
30 .Sh NAME
31 .Nm readelf
32 .Nd display information about ELF objects
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl a | Fl -all
36 .Op Fl c | Fl -archive-index
37 .Op Fl d | Fl -dynamic
38 .Op Fl e | Fl -headers
39 .Op Fl g | Fl -section-groups
40 .Op Fl h | Fl -file-header
41 .Op Fl l | Fl -program-headers
42 .Op Fl n | Fl -notes
43 .Op Fl p Ar section | Fl -string-dump Ns = Ns Ar section
44 .Op Fl r | Fl -relocs
45 .Op Fl t | Fl -section-details
46 .Op Fl v | Fl -version
47 .Oo
48 .Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc |
49 .Fl -debug-dump Ns Op Ns = Ns Ar long-option-name , Ns ...
50 .Oc
51 .Op Fl x Ar section | Fl -hex-dump Ns = Ns Ar section
52 .Op Fl A | Fl -arch-specific
53 .Op Fl D | Fl -use-dynamic
54 .Op Fl H | Fl -help
55 .Op Fl I | Fl -histogram
56 .Op Fl N | -full-section-name
57 .Op Fl S | Fl -sections | Fl -section-headers
58 .Op Fl V | Fl -version-info
59 .Op Fl W | Fl -wide
60 .Ar file...
61 .Sh DESCRIPTION
62 The
63 .Nm
64 utility displays information about ELF objects and
65 .Xr ar 1
66 archives.
67 .Pp
68 The
69 .Nm
70 utility recognizes the following options:
71 .Bl -tag -width indent
72 .It Fl a | Fl -all
73 Turn on the following flags:
74 .Fl d ,
75 .Fl h ,
76 .Fl I ,
77 .Fl l ,
78 .Fl r ,
79 .Fl s ,
80 .Fl A ,
81 .Fl S
82 and
83 .Fl V .
84 .It Fl c | Fl -archive-index
85 Print the archive symbol table for archives.
86 .It Fl d | Fl -dynamic
87 Print the contents of the
88 .Li SHT_DYNAMIC
89 sections in the ELF object.
90 .It Fl e | Fl -headers
91 Print all program, file and section headers in the ELF object.
92 .It Fl g | Fl -section-groups
93 Print the contents of the section groups in the ELF object.
94 .It Fl h | Fl -file-header
95 Print the file header of the ELF object.
96 .It Fl l | Fl -program-headers
97 Print the content of the program header table for the object.
98 .It Fl n | Fl -notes
99 Print the contents of
100 .Li PT_NOTE
101 segments or
102 .Li SHT_NOTE
103 sections present in the ELF object.
104 .It Fl p Ar section | Fl -string-dump Ns = Ns Ar section
105 Print the contents of the specified section as printable strings.
106 The argument
107 .Ar section
108 should be the name of a section or a numeric section index.
109 .It Fl r | Fl -relocs
110 Print relocation information.
111 .It Fl s | Fl -syms | Fl -symbols
112 Print symbol tables.
113 .It Fl t | Fl -section-details
114 Print additional information about sections, such as the flags
115 fields in section headers.
116 .It Fl v | Fl -version
117 Prints a version identifier for
118 .Nm
119 and exits.
120 .It Fl w Ns Oo afilmoprsFLR Oc | Xo
121 .Fl -debug-dump Ns Op Ns = Ns Ar long-option-name , Ns ...
122 .Xc
123 Display DWARF information.
124 The
125 .Fl w
126 option is used with the short options in the following
127 table; the
128 .Fl -debug-dump
129 option is used with a comma-separated list of the corresponding long
130 option names:
131 .Bl -column ".Em Short Option" "aranges|ranges"
132 .It Em Short Option Ta Em Long Option Ta Em Description
133 .It a Ta abbrev Ta Show abbreviation information.
134 .It f Ta frames Ta Show frame information, displaying frame instructions.
135 .It i Ta info Ta Show debugging information entries.
136 .It l Ta rawline Ta Show line information in raw form.
137 .It m Ta macro Ta Show macro information.
138 .It o Ta loc Ta Show location list information.
139 .It p Ta pubnames Ta Show global names.
140 .It r Ta aranges|ranges Ta Show address range information.
141 .It s Ta str Ta Show the debug string table.
142 .It F Ta frames-interp Ta Show frame information, displaying register rules.
143 .It L Ta decodedline Ta Show line information in decoded form.
144 .It R Ta Ranges Ta Show range lists.
145 .El
146 .Pp
147 If no sub-options are specified, the default is to show information
148 corresponding to the
149 .Ar a , f , i, l , o , p , r , s
150 and
151 .Ar R
152 short options.
153 .It Fl x Ar section | Fl -hex-dump Ns = Ns Ar section
154 Display the contents of the specified section in hexadecimal.
155 The argument
156 .Ar section
157 should be the name of a section or a numeric section index.
158 .It Fl A | Fl -arch-specific
159 This option is accepted but is currently unimplemented.
160 .It Fl D | Fl -use-dynamic
161 Print the symbol table specified by the
162 .Li DT_SYMTAB
163 entry in the
164 .Dq Li .dynamic
165 section.
166 .It Fl H | Fl -help
167 Print a help message.
168 .It Fl I | Fl -histogram
169 Print information on bucket list lengths for sections of type
170 .Li SHT_HASH
171 and
172 .Li SHT_GNU_HASH .
173 .It Fl N | Fl -full-section-name
174 This option is accepted but is currently unimplemented.
175 .It Fl S | Fl -sections | Fl -section-headers
176 Print information in the section headers for each ELF object.
177 .It Fl V | Fl -version-info
178 Print symbol versioning information.
179 .It Fl W | Fl -wide
180 Print information about ELF structures using one long line per
181 structure.
182 If this option is not specified,
183 .Nm
184 will list information in the headers of 64 bit ELF objects on two
185 separate lines.
186 .El
187 .Sh EXIT STATUS
188 .Ex -std
189 .Sh SEE ALSO
190 .Xr nm 1 ,
191 .Xr addr2line 1 ,
192 .Xr elfcopy 1 ,
193 .Sh AUTHORS
194 The
195 .Nm
196 utility was written by
197 .An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .