[PATCH] D65882: [LLD][ELF][AArch64] Support for movz, movk tprel relocations

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 08:17:48 PDT 2019


peter.smith created this revision.
peter.smith added reviewers: ruiu, MaskRay, grimar.
Herald added subscribers: kristof.beyls, arichardson, javed.absar, emaste.
Herald added a reviewer: espindola.

This patch Implements the R_AARCH64_TLSLE_MOVW_TPREL_G*[_NC]. These are logically the same calculation as the existing TLSLE relocations with the result written back to mov[nz] and movk instructions. A typical code sequence is:

  movz x0, #:tprel_g2:foo       // bits [47:32] of R_TLS with overflow check
  movk x0, #:tprel_g1_nc:foo // bits [31:16] of R_TLS with no overflow check
  movk x0, #:tprel_g0_nc:foo // bits [15:0] of R_TLS with no overflow check

This type of code sequence is usually used with a large code model.

fixes PR42853

We also do not yet support the :dtprel_g*: and :gottprel_g*: associated with local dynamic and initial exec. These can be added in separate patches as they may need some thought over how to deal with relaxation. The tprel relocations are already local exec so can't be relaxed further.


https://reviews.llvm.org/D65882

Files:
  ELF/Arch/AArch64.cpp
  test/ELF/aarch64-movw-error.s
  test/ELF/aarch64-movw-tprel.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65882.213890.patch
Type: text/x-patch
Size: 4653 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190807/db423cf8/attachment.bin>


More information about the llvm-commits mailing list