# macho: update how we insert output sections · gitcafe/zig

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

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

Visibility: public

Requested revision: bb532584bc569edb563b757c658fd743731837ec

Requested commit: bb532584bc569edb563b757c658fd743731837ec

Commit: bb532584bc569edb563b757c658fd743731837ec

Tree: aa0c1356909f0be2431e5420b0e84ca5ae89e5ad

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: update how we insert output sections

Instead of generating sections upfront, allow generation by scanning
the object files for input -> output sections mapping. Next, always
strive to keep output sections in the final container sorted as they
appear in the final binary. This makes the linker less messy wrt
handling of output sections sort order for dyld/macOS not to complain.
There's still more work to be done for incremental context though
to make this work but looks promising already.

```

## Parents

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

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