Thursday, February 5, 2009

Binutils and objdump on Mac OS 10.4

For some reason OS X (10.4) does not contain objdump.  Seems like quite a useful tool to leave out.  Some searching revealed that objdump is part of binutils.  After much failure trying to install binutils 2.19 for OS X (10.4), I finally came across the supported version on the Apple website (binutils 2.16).  This version of binutils successfully compiled, but much to my chagrin, did not produce any binaries (weird).

To make a long story short, otools, does come with at least the developer tools for OS 10.4, and provides the same functionality as objdump.  Sample usage:

otools -tv a.out

The above will print out the disassembled assembly code of a.out.  You can do other nifty things like print out the shared libraries used.  I hope this saves someone some trouble.