OTOOL(1) — UNIX Programmer’s Manual
NAME
otool − object file printing tool
SYNOPSIS
otool [ option ] ... file ...
DESCRIPTION
Otool prints specified parts of object files or libraries. The file arguments may be of the form libx.a(foo.o) which specifies to print information only about that object file and not the entire library (typically this argument must be quoted, “libx.a(foo.o)”, to get it past the shell). Otool understands both Mach-O (Mach object) files and 4.3BSD a.out file formats. It can print the specified information in either its raw (numeric) form (without the −v flag) or in a symbolic form, using macro names of constants, etc. (with the −v or −V flag).
One of the following options must be specified:
−a Print the archive header if the file is an archive.
−S Print the contents of the ‘__.SYMDEF’ file if the file is an archive.
−h Print the mach header (for Mach-O files) or the exec header (for 4.3BSD a.out files).
−l Print the load commands (for Mach-O files).
−L Print the names of the target shared libraries the object file uses.
−t Print the contents of the __text section (for Mach-O files) or the text segment (for 4.3BSD a.out files). With the −v flag this disassembles the text. And with −V it also symbolically disassembles the operands.
−d Print the contents of the __data section (for Mach-O files) or the data segment (for 4.3BSD a.out files).
−o Print the contents of the __OBJC segment used by the Objective-C runtime system.
−O Print the strings in the __selector_strs and their offset’s in that section.
−r Print the relocation entries.
−g Print the symseg’s (produced with the −gg option of the compiler).
Some of the following options may also be given:
−p name
Used with the −t and −v or −V options to start the disassembly from symbol name and continue to the end of the __text section. −T hex number Used with the −t and −v or −V options to indicate an 4.3BSD a.out OMAGIC file was really loaded at hex number rather than the default. This is needed because there is no way to tell where an 4.3BSD a.out file was loaded from the file if it was not loaded at the default address.
−v Print verbosely (symbolically) when possible.
−V Print the disassembled operands symbolically (this implys the −v option). This is used with the −t option.
BUGS
Since constant data is also placed in the __text section disassembling those parts appears to be garbage.
NeXT, Inc. — June 1, 1989