# macho: prefill any space between \_\_DATA and \_\_LINKEDIT with 0s if required · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/8378cde74369ddb1cc618d444970e963a4ab1110)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 8378cde74369ddb1cc618d444970e963a4ab1110

Requested commit: 8378cde74369ddb1cc618d444970e963a4ab1110

Commit: 8378cde74369ddb1cc618d444970e963a4ab1110

Tree: 62bec6ea56c64a96c13ba304d35320b80184d013

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: prefill any space between __DATA and __LINKEDIT with 0s if required

If there are zerofill sections, the loader may copy the contents of
the physical space in file directly into memory and attach that to
the zerofill section. This is a performance optimisation in the loader
but requires us, the linker, to properly zero-out any space between
__DATA and __LINKEDIT segments in file. This is of course completely
skipped if there are no zerofill sections present.

```

## Parents

- [0ae2ea671b867e5ecd0bc779405c175f33316559](https://git.cafe/gitcafe/zig/commit/0ae2ea671b867e5ecd0bc779405c175f33316559?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/8378cde74369ddb1cc618d444970e963a4ab1110?format=markdown)
