# add ability to pass force undefined symbols to the linker · gitcafe/zig

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

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

Visibility: public

Requested revision: d5233ee85ce13cba3dd03e4c0c938cee193b9b19

Requested commit: d5233ee85ce13cba3dd03e4c0c938cee193b9b19

Commit: d5233ee85ce13cba3dd03e4c0c938cee193b9b19

Tree: 3824be936b8854e15916159dd8eb5636fd84168c

Author: Jakub Konka

Committer: Andrew Kelley

## Message

```
add ability to pass force undefined symbols to the linker

This commit enables `-u <symbol>` for ELF and `-include:<symbol>` for
COFF linkers for use internally. This means we do not expose these
flags to the users just yet, however, we make use of them internally
whenever required. One such use case is forcing inclusion of
`_tls_index` when linking for Windows with mingw and LTO and dead
code stripping enabled. This ensures we add `_tls_index` to the symbol
resolver as an undefined symbol and force the linker to include an atom
that provides it marking it a dead-code-stripping root - meaning it will
not be garbage collected by the linker no matter what.

```

## Parents

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

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