836
[darwin-xtools.git] / cctools / man / otool.1
blob681111b7b70894b7217049f77ba674935e52e22f
1 .TH OTOOL 1 "May 21, 2012" "Apple, Inc."
2 .SH NAME
3 otool \- object file displaying tool
4 .SH SYNOPSIS
5 .B otool
6
7 .I "option \&..."
8 ] [ 
9 .I "file \&..."
10
11 .SH DESCRIPTION
12 The
13 .I otool
14 command displays specified parts of object files or libraries.  If the,
15 .B \-m
16 option is not used, the file
17 arguments may be of the form
18 .IR "libx.a(foo.o)" ,
19 to request information about only that object file and not
20 the entire library.   (Typically this argument must be quoted,
21 .I ``libx.a(foo.o)'',
22 to get it past the shell.)
23 .I  Otool
24 understands both Mach-O (Mach object) files and universal file formats.
25 .I  Otool
26 can display the specified information in either its raw (numeric) form
27 (without the
28 .B \-v
29 flag), or in a symbolic form using macro names of constants, etc. (with the 
30 .B \-v
32 .B \-V
33 flag).
34 .PP
35 At least one of the following options must be specified:
36 .TP
37 .B \-a
38 Display the archive header, if the file is an archive.
39 .TP
40 .B \-S
41 Display the contents of the `\_\^\_.SYMDEF' file, if the file is an archive.
42 .TP
43 .B \-f
44 Display the universal headers.
45 .TP
46 .B \-h
47 Display the Mach header.
48 .TP
49 .B \-l
50 Display the load commands.
51 .TP
52 .B \-L
53 Display the names and version numbers of the shared libraries that the object
54 file uses.  As well as the shared library ID if the file is a shared library.
55 .TP
56 .B \-D
57 Display just install name of a shared library.
58 .TP
59 .BI \-s " segname sectname"
60 Display the contents of the section
61 .RI ( segname,sectname ).
62 If the
63 .B \-v
64 flag is specified, the section is displayed as its type, unless the type is
65 zero (the section header flags).  Also the sections
66 (\_\^\_OBJC,\_\^\_protocol),
67 (\_\^\_OBJC,__string_object) and (\_\^\_OBJC,\_\^\_runtime_setup) are displayed
68 symbolically if the
69 .B \-v
70 flag is specified.
71 .TP
72 .B \-t
73 Display the contents of the (\_\^\_TEXT,\_\^\_text) section.  With the
74 .B \-v
75 flag, this disassembles the text.  And with
76 .BR \-V ,
77 it also symbolically disassembles the operands.
78 .TP
79 .B \-d
80 Display the contents of the (\_\^\_DATA,\_\^\_data) section.
81 .TP
82 .B \-o
83 Display the contents of the \_\^\_OBJC segment used by the Objective-C run-time
84 system.
85 .TP
86 .B \-r
87 Display the relocation entries.
88 .TP
89 .B \-c
90 Display the argument strings (argv[] and envp[]) from a core file.
91 .TP
92 .B \-I
93 Display the indirect symbol table.
94 .TP
95 .B \-T
96 Display the table of contents for a dynamically linked shared library.
97 .TP
98 .B \-R
99 Display the reference table of a dynamically linked shared library.
101 .B \-M
102 Display the module table of a dynamically linked shared library.
104 .B \-H
105 Display the two-level namespace hints table.
107 .B \-G
108 Display the data in code table.
111 The following options may also be given:
113 .BI "\-p " name
114 Used with the
115 .B \-t
117 .B \-v
119 .B \-V
120 options to start the disassembly from symbol
121 .I name
122 and continue to the end of the (\_\^\_TEXT,\_\^\_text) section.
124 .B \-v
125 Display verbosely (symbolically) when possible.
127 .B \-V
128 Display the disassembled operands symbolically (this implies the
129 .B \-v
130 option).  This is useful with the
131 .B \-t
132 option.
134 .B \-X
135 Don't print leading addresses or headers with disassembly of sections.
137 .B \-q
138 Use the llvm disassembler when doing disassembly, this is available for the x86
139 and arm architectures.
140 .B \-Q
142 .IR otool (1)'s
143 disassembler when doing disassembly.
145 .BI \-arch " arch_type"
146 Specifies the architecture,
147 .I arch_type,
148 of the file for
149 .IR otool (1)
150 to operate on when the file is a universal file.  (See
151 .IR arch (3)
152 for the currently know
153 .IR arch_type s.)
155 .I arch_type
156 can be "all" to operate on all architectures in the file.
157 The default is to display only the host architecture, if the file contains it;
158 otherwise, all architectures in the file are shown.
160 .B \-m
161 The object file names are not assumed to be in the archive(member) syntax,
162 which allows file names containing parenthesis.
163 .SH "SEE ALSO"
164 install_name_tool(1), dyld(1) and libtool(1)