bytecodealliance / bytecodealliance/wasmtime

Allow using TLSDESC TLS access for ELF on x86 and riscv

Open
#12,087 0 comments 0 reactions 0 assignees View on GitHub
cranelift cranelift:area:riscv64 cranelift:area:x86
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 19h
Merged PRs (30d)
121

Description

#### Feature

See title

#### Benefit

TLSDESC is a more efficient alternative to the traditional `__tls_get_addr` that is used for the global-dynamic tls model. TLSDESC is already mandatory on arm64. They were introduced relatively recently on x86 (2008, but with a glibc bugfix in 2024) and riscv (2024), so we should keep them optional for the time being. https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/94 links a bunch of useful documents. Also cc https://github.com/rust-lang/rust/pull/132480

#### Implementation

Add the required relocation types and adapt the TLS access binemit code as relevant.

#### Alternatives

Not support this and accept slower TLS accesses.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.