Skip to content

Allow using TLSDESC TLS access for ELF on x86 and riscv #12087

@bjorn3

Description

@bjorn3

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. riscv-non-isa/riscv-elf-psabi-doc#94 links a bunch of useful documents. Also cc rust-lang/rust#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions