# stage2.Elf: fix off by one error in writeOffsetTableEntry · gitcafe/zig

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

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

Visibility: public

Requested revision: ad6e095ef676ab50799a49eb40419b1ff926e6d7

Requested commit: ad6e095ef676ab50799a49eb40419b1ff926e6d7

Commit: ad6e095ef676ab50799a49eb40419b1ff926e6d7

Tree: 73b1ab2059c70a6c48e152aa9f1ee2eb778c322b

Author: Timon Kruiper

Committer: Andrew Kelley

## Message

```
stage2.Elf: fix off by one error in writeOffsetTableEntry

The code was using the length of the local symbols, which also
includes the null symbol. Fix this by using the offset table instead,
which only keeps track of the symbols that end up in the got.

```

## Parents

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

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