TLS Descriptors (TLSDESC) are an alternative implementation of the
Global Dynamic model that allows the dynamic linker to achieve
performance close to that of Initial Exec when the library was not
loaded dynamically with dlopen. For each TLSDESC relocation inside
the GOT, the dynamic linker fills in the TLS descriptor.
This patch adds basic support in the RISC-V backend by adding new
relocation types and some new pseudo instructions. Optimization for the
local dynamic case will be handled in future patches.
The implementation is currently only enabled by passing the
riscv-enable-tlsdesc flag, since support in libc is not generally
available yet. Subsequent patches can enable TLSDESC by default for
RISCV.
This work is based on the RISC-V psABI proposal:
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/373