On 5 Sep 2011, at 07:47, Robert Bielik wrote:
I'm trying to get my binary stripped of symbols, but no matter what I've chosen, i.e. STRIP_INSTALLED_PRODUCT/STRIP_STYLE/DEPLOYMENT_PROCESSING
visibility=hidden,inlines hidden etc. etc., my binary still is PEPPERED with symbols. I'm using Xcode 3.2.2 with gcc 4.0.
What to do ?
As I understand it there will always be some symbols around, it's just the ones you created that get removed. It may be a good idea to use the nm command before attempting stripping and then after - to see what's going on.
The following instructions are from my notes, and work for me. Someone else may be able to tell you if I was doing anything wrong...
You can use the NM command line tool to examine your code’s symbol table before and after stripping. The command takes the basic form:
nm -a /FullPath/Bundle.app/Contents/MacOS/Executable
To dead-code strip from the compiler:
- Select the project icon in Groups & Files
- File > Get Info
- Choose the Build tab
- Configuration: Release
- Show: All Settings
- In the search field type “strip”
Use the following settings (some may be on already):
Title
|
Name
|
Value
|
Deployment Postprocessing
|
DEPLOYMENT_POSTPROCESSING
|
√
|
Strip Debug Symbols During Copy
|
COPY_PHASE_STRIP
|
√
|
Strip Linked Product
|
STRIP_INSTALLED_PRODUCT
|
√
|
Strip Style
|
STRIP_STYLE
|
All Symbols
|
Use Separate Strip
|
SEPARATE_STRIP
|
√
|
Dead Code Stripping
|
DEAD_CODE_STRIPPING
|
√
|
There may be some Crate Worship here, but these settings do seem to produce the desired results.
Warning: Check that these settings are set for the target level.
Warning: To prevent warnings change "Debug Information Format" to "DWARF with dSYM File"
The strip command line tool may also be used to dead-code strip an executable:
strip -S -x /FullPath/Bundle.app/Contents/MacOS/Executable
Although this is effective it does not seam to work quite as well as the build method.
---
Hope that helps,
Dave