[PATCH] D18790: [lld] [ELF/AArch64] Implemented set of R_AARCH64_TLSDESC_* relocations

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 07:26:55 PDT 2016


zatrazz created this revision.
zatrazz added reviewers: ruiu, rafael.
zatrazz added subscribers: llvm-commits, rengolin.
zatrazz set the repository for this revision to rL LLVM.
zatrazz added a project: lld.
Herald added a subscriber: aemerson.

This patch implements next relocations:

 * R_AARCH64_TLSDESC_ADR_PAGE21,
 * R_AARCH64_TLSDESC_LD64_LO12_NC,
 * R_AARCH64_TLSDESC_ADD_LO12_NC, 
  *R_AARCH64_TLSDESC_CALL.

They have lazy relocation nature, so require entries in got.plt. Each one
is double sized. Also special Plt entry with resolver is created in
addition to single got entry. A module that uses lazy TLSDESC relocations
must define next two entries in dynamic section:

 * DT_TLSDESC_PLT - Location of PLT entry for TLS descriptor resolver calls.
 *DT_TLSDESC_GOT - Location of GOT entry used by TLS descriptor resolver PLT entry.

More information can be found in "Thread-Local Storage Descriptors for IA32 and
AMD64/EM64T" and "Thread-Local Storage Descriptors for the ARM platform"
(http://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-x86.txt,
http://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-ARM.txt)

PS: this patch is based on http://reviews.llvm.org/D18330 with difference now I used two
different vectors: one for jump slots and another one for tlsdesc (it should not slow down
tlsdesc operations now it have a separate vector).

Repository:
  rL LLVM

http://reviews.llvm.org/D18790

Files:
  ELF/InputSection.cpp
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  ELF/Symbols.cpp
  ELF/Symbols.h
  ELF/Target.cpp
  ELF/Target.h
  ELF/Writer.cpp
  test/ELF/aarch64-tls-desc.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18790.52686.patch
Type: text/x-patch
Size: 33402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160405/aee86dac/attachment.bin>


More information about the llvm-commits mailing list