I opened up my compiled Hello World Obj-C application in a text editor and, to my surprise, I found about 8 kilobytes of 00 00 00 00 00 00 00 00 ….
Why are these here? Is there a way to clear out these zeroes (which I doubt have too much function)?
Obviously it’s not so important in this file, seeing as it’s only 16kB to begin with, but I’d like to know anyway.
It’s most likely padding between code, data, relocation or other sections of the executable format you use.
Linkers like to pad such sections on a 4k or 8k boundary. This improves loading time for the price of a bit of memory-waste.
For a simple hello world it’s significant, but for a large application the extra memory used for the padding is neglible.