# macho: do not preempt segment headers; do it when commiting to file · gitcafe/zig

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

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

Visibility: public

Requested revision: 90e326827062fc7899d02516cdaffa7da8366077

Requested commit: 90e326827062fc7899d02516cdaffa7da8366077

Commit: 90e326827062fc7899d02516cdaffa7da8366077

Tree: 8709238e09db8a89bad1e2414c7e833861f10bb7

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: do not preempt segment headers; do it when commiting to file

This way, tracking segment-to-section mapping becomes a lot easier
since it's effectively just start index plus number of sections
defined within the segment. If a section becomes empty however
care needs to be taken to remove the header upon committing to the
final binary.

```

## Parents

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

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