# macho: fix parsing addend for non-extern SIGNED_X reloc · gitcafe/zig

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

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

Visibility: public

Requested revision: 7e27ab09476870e4b37a04172043c66b4bd77c20

Requested commit: 7e27ab09476870e4b37a04172043c66b4bd77c20

Commit: 7e27ab09476870e4b37a04172043c66b4bd77c20

Tree: 1200fa721801ac675842b160a437a63907da84ce

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: fix parsing addend for non-extern SIGNED_X reloc

If `r_extern == 0` (the relocation is non-extern, meaning it targets
a specific memory offset within the object's section) and if the
relocation type signifies that the relocation requires correction
for RIP such as SIGNED_1, then we need to subtract the correction,
here 1 for SIGNED_1, from the calculated addend value as it's
implicitly included.

```

## Parents

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

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