HomePhabricator

[lld] [ELF/AArch64] Add support to some GD/LE/IS TLS relocations
Audit RequiredrL260677

Description

[lld] [ELF/AArch64] Add support to some GD/LE/IS TLS relocations

This patch adds some TLS relocations and relaxations for AArch64.
Some Global-Dynamic relocation are handled by optimizing them to
Local-Exec (Initial-Exec is not yet supported). They are:

  • R_AARCH64_TLSDESC_ADR_PAGE21
  • R_AARCH64_TLSDESC_LD64_LO12_NC
  • R_AARCH64_TLSDESC_ADD_LO12_NC
  • R_AARCH64_TLSDESC_CALL

Also some Init-Exec is optimized to Local-Exec if possible. They are:

  • R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21
  • R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC

Finally some Local-Exec relocation are handled in relocateOne:

  • R_AARCH64_TLSLE_ADD_TPREL_HI12
  • R_AARCH64_TLSLE_ADD_TPREL_LO12_NC

This work is mainly for compiler bootstrap, where static binaries is
showing good progress (although shared object still lacking support
from both TLS aarch64 backend and some other issues).

Details

Auditors
Bigcheese
Committed
azanellaFeb 12 2016, 5:43 AM
Parents
rL260676: Fix uninitialized memory read.
Branches
Unknown
Tags
Unknown