# wasm: correctly generate relocations for type index · gitcafe/zig

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

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

Visibility: public

Requested revision: 5aec88fa4102e87295bf60971209d114c6ae6733

Requested commit: 5aec88fa4102e87295bf60971209d114c6ae6733

Commit: 5aec88fa4102e87295bf60971209d114c6ae6733

Tree: aa4a533cf831d6bb93f7b647b5d253059e20a29e

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: correctly generate relocations for type index

Previously we could directly write the type index because we used the
index that was known in the final binary. However, as we now process
the Zig module as its own relocatable object file, we must ensure to
generate a relocation for type indexes. This also ensures that we can
later link the relocatable object file as a standalone also.

This also fixes generating indirect function table entries for ZigObject
as it now correctly points to the relocation symbol index rather than
the symbol index that owns the relocation.

```

## Parents

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

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