Why is half of my compiled (small) objective-C file a large block of zeros?

I opened my compiled Hello World Obj-C application in a text editor and, to my surprise, found about 8 kilobytes 00 00 00 00 00 00 00 00 00 ....

Why are they here? Is there a way to clear these zeros (which I doubt is too many functions)?

Obviously, this is not so important in this file, since for starters you only need 16kB, but I would like to know anyway.

+3
source share
4 answers

Most likely, this is a gap between the code, data, movement, or other sections of the executable format that you are using.

Linkers like to fill out such sections on the 4k or 8k border. This improves boot time at the cost of a bit of memory loss.

, , , .

+7

Objective-C ? , .

0

. , - , . , , .

0

, ? , C- , static, , . . , ( , ) 8 .

-1

Source: https://habr.com/ru/post/1697625/


All Articles