# wasm linker: implement missing logic · gitcafe/zig

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

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

Visibility: public

Requested revision: 458f658b427c26ede2776a04113ba00a3a491793

Requested commit: 458f658b427c26ede2776a04113ba00a3a491793

Commit: 458f658b427c26ede2776a04113ba00a3a491793

Tree: 0dcb397bb124a786d35697a93265305f800da7f1

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
wasm linker: implement missing logic

fix some compilation errors for reworked Emit now that it's actually
referenced

introduce DataSegment.Id for sorting data both from object files and
from the Zcu.

introduce optimization: data segment sorting includes a descending sort
on reference count so that references to data can be smaller integers
leading to better LEB encodings. this optimization is skipped for object
files.

implement uav address access function which is based on only 1 hash
table lookup to find out the offset after sorting.

```

## Parents

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

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