xref: /freebsd/contrib/elftoolchain/elfdump/elfdump.1 (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1.\" Copyright (c) 2003 David O'Brien
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.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD: src/usr.bin/elfdump/elfdump.1,v 1.6 2005/01/18 13:43:48 ru Exp $
26.\" $Id: elfdump.1 3231 2015-07-30 13:47:56Z emaste $
27.\"
28.Dd August 25, 2011
29.Dt ELFDUMP 1
30.Os
31.Sh NAME
32.Nm elfdump
33.Nd "display information about"
34.Tn ELF
35files
36.Sh SYNOPSIS
37.Nm
38.Fl a | cdeGhiknprsv
39.Op Fl S
40.Op Fl V
41.Op Fl N Ar name
42.Op Fl w Ar file
43.Ar file ...
44.Sh DESCRIPTION
45The
46.Nm
47utility
48dumps various information about the specified
49.Tn ELF
50.Ar file .
51.Pp
52The options are as follows:
53.Bl -tag -width ".Fl w Ar file"
54.It Fl a
55Dump all information.
56.It Fl c
57Dump section headers.
58.It Fl d
59Dump dynamic symbols.
60.It Fl e
61Dump ELF header.
62.It Fl G
63Dump the GOT.
64.It Fl h
65Dump the hash values.
66.It Fl i
67Dump the dynamic interpreter.
68.It Fl k
69Dump the ELF checksum.
70.It Fl n
71Dump note sections.
72.It Fl N Ar name
73Only dump the section with the specific
74.Ar name .
75Archive symbol table can be specified with
76the special section name ARSYM.
77More than one
78.Fl N
79option may appear.
80.It Fl p
81Dump the program header.
82.It Fl r
83Dump relocations.
84.It Fl s
85Dump the symbol table.
86.It Fl S
87Output in the Solaris
88.Nm
89format.
90.It Fl v
91Dump the symbol-versioning sections.
92.It Fl V
93Print a version identifier and exit.
94.It Fl w Ar file
95Write output to a
96.Ar file
97instead of the standard output.
98.El
99.Sh EXIT STATUS
100.Ex -std
101.Sh EXAMPLES
102The following is an example of a typical usage
103of the
104.Nm
105command:
106.Pp
107.Dl "elfdump -a -w output /bin/ls"
108.Pp
109To dump the content of '.dynsym' symbol table:
110.Pp
111.Dl "elfdump -s -N .dynsym /bin/ls"
112.Pp
113To dump the archive symbol table,
114but not the symbol tables of archive members:
115.Pp
116.Dl "elfdump -s -N ARSYM /usr/lib/libelf.a"
117.Pp
118To dump the content of .got section and
119the symbol-versioning sections in Solaris
120.Nm
121format:
122.Pp
123.Dl "elfdump -S -Gv /bin/ls"
124.Sh SEE ALSO
125.Xr objdump 1 ,
126.Xr readelf 1 ,
127.Xr elf 3
128.Rs
129.%A "AT&T Unix Systems Labs"
130.%T "System V Application Binary Interface"
131.%O http://www.sco.com/developers/gabi/
132.Re
133.Sh HISTORY
134The
135.Nm
136utility first appeared in
137.Fx 5.0 .
138.Sh AUTHORS
139.An -nosplit
140The
141.Nm
142utility
143was written by
144.An Jake Burkholder Aq Mt jake@FreeBSD.org .
145Later it was rewritten based on the
146libelf library.
147This
148manual page was written by
149.An David O'Brien Aq Mt obrien@FreeBSD.org .
150.Pp
151.An Kai Wang Aq Mt kaiw@FreeBSD.org
152rewrote it using the
153.Lb libelf
154and implemented additional functionality.
155.Sh BUGS
156Does not fully implement the
157.Tn ELF
158gABI.
159