# wasm-linker: convert relocation addend to i32 · gitcafe/zig

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

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

Visibility: public

Requested revision: 7f508480f49b78817bf67579a8810d4499cbbc13

Requested commit: 7f508480f49b78817bf67579a8810d4499cbbc13

Commit: 7f508480f49b78817bf67579a8810d4499cbbc13

Tree: d1f9dbed875ae37d2ebf5997cc0d2cde9e3bdfa0

Author: Luuk de Gram

Committer: Joachim Schmidt

## Message

```
wasm-linker: convert relocation addend to i32

Addends in relocations are signed integers as theoretically it could
be a negative number. As Atom's offsets are relative to their parent
section, the relocation value should still result in a postive number.
For this reason, the final result is stored as an unsigned integer.

Also, rather than using `null` for relocations that do not support
addends. We set the value to 0 for those that do not support addends,
and have to call `addendIsPresent` to determine if an addend exists
or not. This means each Relocation costs 4 bytes less than before,
saving memory while linking.

```

## Parents

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

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