summaryrefslogtreecommitdiffstats
path: root/src/doc/unstable-book/src/language-features/asm-sym.md
blob: 103d91caf4ccd4c4e716cd3aeaed69e8086e078a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# `asm_sym`

The tracking issue for this feature is: [#93333]

[#93333]: https://github.com/rust-lang/rust/issues/93333

------------------------

This feature adds a `sym <path>` operand type to `asm!` and `global_asm!`.
- `<path>` must refer to a `fn` or `static`.
- A mangled symbol name referring to the item is substituted into the asm template string.
- The substituted string does not include any modifiers (e.g. GOT, PLT, relocations, etc).
- `<path>` is allowed to point to a `#[thread_local]` static, in which case the asm code can combine the symbol with relocations (e.g. `@plt`, `@TPOFF`) to read from thread-local data.