Stripping symbols from a Mach-O

A common mistake many developers do is to leave names of local symbols inside applications built on OS X. Using the strip utility combined with the compiler visibility flags is, unfortunately, not enough.

So I wrote a small script for Profiler to be run from the command line and I integrated it in the build process.

The syntax to execute the script is:

Here’s the whole code:

The code zeroes names of symbols which are not associated to any section in the binary.

Easy. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *