# wasm-linker: Allow for creation of local symbols · gitcafe/zig

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

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

Visibility: public

Requested revision: 28acbdb02ff934fed3363a580128575e7d8c92ee

Requested commit: 28acbdb02ff934fed3363a580128575e7d8c92ee

Commit: 28acbdb02ff934fed3363a580128575e7d8c92ee

Tree: fb9e5e49d24353c714754333b6083f88d247daaf

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-linker: Allow for creation of local symbols

The backend can create annonymous local symbols. This can be used for constants
that will be passed by reference so it will not have to be lowered to the stack, and then
stored into the data section. This also means it's valid to return a pointer to a constant array.

Those local symbols that are created, will be managed by the parent decl. Free'ing the parent decl,
will also free all of its locals.

When a local symbol was created, the index of said symbol will be returned and saved in the `memory`
tag of a `WValue` which is then memoized. This means that each 'emit' of this WValue will create a relocation
for that constant/symbol and the actual pointer value will be set after relocation phase.

```

## Parents

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

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