# macho: do not assume every object has a symtab · gitcafe/zig

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

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

Visibility: public

Requested revision: 5391541f11570dc444bfb79e5cf0e89aa872d0b8

Requested commit: 5391541f11570dc444bfb79e5cf0e89aa872d0b8

Commit: 5391541f11570dc444bfb79e5cf0e89aa872d0b8

Tree: cb52d2a38af4581be8ef16f099e570bd5c538741

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: do not assume every object has a symtab

For example, building stage2 requires an empty `empty.cc` source file
compiling which generates a valid translation unit with no symtab/strtab.
In this case, we cannot simply assume that every translation unit will
have a valid symtab; instead, we cautiously default the input symtab
and strtab fields to optional `null` to signal symtab's presence or its lack of.
In case the symtab is not present, we catch this fact when splitting
input sections into subsections and create a synthetic symbol per every
suitable section.

```

## Parents

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

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