# wasm-linker: de-duplicate functions\+atom sorting · gitcafe/zig

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

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

Visibility: public

Requested revision: 4d3715d89f97f3f9b6e366bbabe01f9d64ed56cf

Requested commit: 4d3715d89f97f3f9b6e366bbabe01f9d64ed56cf

Commit: 4d3715d89f97f3f9b6e366bbabe01f9d64ed56cf

Tree: 593ec4b37a1c8f1e1a626076144aa310f7083aa4

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-linker: de-duplicate functions+atom sorting

Multiple symbols can point to the same function, this means that when we loop over
the symbol list, we must deduplicate those functions being added twice.
Additionaly, we must also ensure that when we append a new type and set the type
index on a function, we must not do this again for the same function.

This commit also implements sorting of code atoms to ensure their order matches
the order of the function section to ensure the function signature matches
that of the function body.

```

## Parents

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

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