# wasm-linker: create TLS Wasm globals correctly · gitcafe/zig

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

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

Visibility: public

Requested revision: 142dbc7b82c741692dd17f8c0455203826342bba

Requested commit: 142dbc7b82c741692dd17f8c0455203826342bba

Commit: 142dbc7b82c741692dd17f8c0455203826342bba

Tree: 89899879d0bc08f077e3f0d2a4de1164a414eaa0

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-linker: create TLS Wasm globals correctly

Previously, they were only created when we had any TLS segment.
This meant that while the symbol existed, the global itself wouldn't.
The result of this was a crash during symbol names writing as it
would attempt to write the symbol name of a global that didn't exist.
Now we always create them, and instead update its `init` value during
`setupMemory`.

In the future, the entire symbol (and global) will be removed by
the garbage collector.

```

## Parents

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

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