<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Otool on Arcanelab Blog</title><link>https://blog.arcanelab.com/tags/otool/</link><description>Recent content in Otool on Arcanelab Blog</description><generator>Hugo</generator><language>en-US</language><copyright>Zoltán Majoros</copyright><lastBuildDate>Tue, 26 Apr 2016 01:25:00 +0200</lastBuildDate><atom:link href="https://blog.arcanelab.com/tags/otool/index.xml" rel="self" type="application/rss+xml"/><item><title>otool / nm examples Printing object files included in the library and their exported…</title><link>https://blog.arcanelab.com/2016/04/otool-nm-examples-printing-object-files-included-in-the/</link><pubDate>Tue, 26 Apr 2016 01:25:00 +0200</pubDate><guid>https://blog.arcanelab.com/2016/04/otool-nm-examples-printing-object-files-included-in-the/</guid><description>&lt;h1&gt;otool / nm examples&lt;/h1&gt;
&lt;h2&gt;Printing object files included in the library and their exported functions&lt;/h2&gt;
&lt;pre&gt;
$&amp;gt;otool -SV /usr/local/lib/libSDL2_image.a

Archive : /usr/local/lib/libSDL2_image.a
Table of contents from: /usr/local/lib/libSDL2_image.a(__.SYMDEF SORTED)
size of ranlib structures: 392 (number 49)
size of strings: 696
object symbol name
IMG.o _IMG_Init
IMG_jpg.o _IMG_InitJPG
IMG_png.o _IMG_InitPNG
IMG_tif.o _IMG_InitTIF
IMG_webp.o _IMG_InitWEBP
IMG.o _IMG_Linked_Version
IMG.o _IMG_Load
IMG_bmp.o _IMG_LoadBMP_RW
IMG_bmp.o _IMG_LoadCUR_RW
...
&lt;/pre&gt;
&lt;h2&gt;Printing shared libraries used&lt;/h2&gt;
&lt;pre&gt;
$&amp;gt; otool -L /usr/local/lib/libSDL2.dylib

/usr/local/lib/libSDL2.dylib:
 /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib (compatibility version 5.0.0, current version 5.0.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
 /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
 /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
 /System/Library/Frameworks/ForceFeedback.framework/Versions/A/ForceFeedback (compatibility version 1.0.0, current version 1.0.2)
 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
 /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
...
&lt;/pre&gt;
&lt;h2&gt;Printing invoked external functions from executable&lt;/h2&gt;
&lt;pre&gt;
$&amp;gt; otool -IV testapp

testapp:
Indirect symbols for (__TEXT,__stubs) 38 entries
address index name
0x000000010001bc0e 134 ___tolower
0x000000010001bc14 135 _fclose
0x000000010001bc1a 136 _fopen
0x000000010001bc20 137 _fread
0x000000010001bc26 138 _fseek
0x000000010001bc2c 139 _ftell
0x000000010001bc32 140 _memcpy
0x000000010001bc38 141 _memset
0x000000010001bc3e 142 _printf
0x000000010001bc44 143 _puts
0x000000010001bc4a 144 _snprintf
0x000000010001bc50 145 _strlen
...
&lt;/pre&gt;
&lt;h2&gt;Listing all symbols (internal/external) in binary files&lt;/h2&gt;
&lt;pre&gt;
nm [file]

Example snippet:
0000000100001560 T _main
 U _memcpy
 U _memset
 U _printf
 U _puts
 U _snprintf
 U _strlen
 U dyld_stub_binder
&lt;/pre&gt;
&lt;p&gt;More info on &lt;code&gt;nm&lt;/code&gt; on &lt;a href="https://en.wikipedia.org/wiki/Nm_%28Unix%29"&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>