Zero Link and code size in "deployment" and "development" build styles
Zero Link and code size in "deployment" and "development" build styles
- Subject: Zero Link and code size in "deployment" and "development" build styles
- From: Greg Hurrell <email@hidden>
- Date: Sun, 7 Dec 2003 16:09:14 +0100
I just noticed that with my current Xcode project the binary produced
by my "Deployment" build style is much larger than that produced by my
"Development" build style. Intrigued, I did a bit of further
investigation, and made the following observations that I'd like to
share:
1. The Development build produced an executable of only 13k in size.
2. The Deployment build produced an executable of 113k in size.
3. Doing another Development build, but this time without "Zero Link",
the executable size went up to over 600k.
This is pretty much in line with what I would expect, if using Zero
Link means that less information has to be linked into the binary, but
I then started wondering how much information might be available to a
snooper running tools like "strings" and "otool" on the command line.
Here are the results:
1. Development build (Zero Link enabled, no optimisation, unstripped
binary, debugging symbols)
$ otool -ov TestApp | wc
3 10 99
$ otool -ov TestApp
TestApp:
Objective-C segment
can't print objective-C information no (__OBJC,__module_info) section
$ strings TestApp | wc
26 39 3023
2. Deployment build (optimised for size, binary stripped, no debugging
symbols)
$ otool -ov TestApp | wc
1451 4011 51654
$ strings TestApp | wc
644 1402 14644
3. Development build (Zero Link disabled, no optimisation, unstripped
binary, debugging symbols)
$ otool -ov TestApp | wc
1451 4395 59116
$ strings TestApp | wc
662 1425 15886
So, I was quite surprised to see that in the Zero Link build, the
"strings" utility basically couldn't find any ASCII strings in the
binary (only 26 lines, compared with over 600 in the other two builds).
Needless to say, all three builds run correctly, so the information is
obviously still in there (and on inspection, I saw that it is in the
".build" directory with the other intermediaries).
I was also surprised (although I shouldn't have been if I really
understood what Zero Link does) to see that in the Zero Link build, the
efficacy of the "otool" command was significantly impaired, basically
yielding no useful information at all (once again, this is because the
linking phase has been skipped and the app is being launched directly
from the .o files, again in the ".build" directory).
I basically just wanted to send these comments to the list to
potentially spare some other users (newbies like me) some head
scratching when they notice that their Development builds are smaller
than their Deployment ones, which can certainly seem counter-intuitive
at first...
Best wishes,
Greg
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.