[PATCH] D18960: [lld] Initial implementation of TLSDESC relocation handling

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 14:54:30 PDT 2016


ruiu added a comment.

Rafael should know more about relocations, so you want to have him take a look.


================
Comment at: ELF/InputSection.cpp:160-162
@@ -158,1 +159,5 @@
+    return Body.getGotPltTlsDescVA<ELFT>() + A;
+  case R_TLSDESC_PAGE:
+    return getAArch64Page(Body.getGotPltTlsDescVA<ELFT>() + A) -
+           getAArch64Page(P);
   case R_PLT:
----------------
You are not using T_TLSDESC_PAGE. Please remove.

================
Comment at: ELF/OutputSections.cpp:735
@@ +734,3 @@
+template <class ELFT, class Entry, class ElfDyn>
+static void handleSpecialDynamic(const Entry &E, ElfDyn *P) {
+  switch (E.Tag) {
----------------
"Special" is not a good name. Once this code is submitted, this code becomes a regular part of the linker.

================
Comment at: ELF/OutputSections.h:142
@@ -138,2 +141,3 @@
   uint32_t TlsIndexOff = -1;
+  uintX_t TlsDescEntryOff = -1;
   uint32_t MipsLocalEntries = 0;
----------------
Use uint32_t instead of uintX_t. Realistically, we'll never have a GOT which contains more than 2^32 entries.

================
Comment at: ELF/Writer.cpp:282
@@ +281,3 @@
+template <class ELFT>
+static unsigned handleTlsGDReloc(uint32_t Type, SymbolBody &Body,
+                                 InputSectionBase<ELFT> &C,
----------------
GD -> Gd

================
Comment at: ELF/Writer.cpp:300
@@ +299,3 @@
+template <class ELFT>
+static unsigned handleTLSDescReloc(uint32_t Type, SymbolBody &Body,
+                                   InputSectionBase<ELFT> &C,
----------------
TLS -> Tls


http://reviews.llvm.org/D18960





More information about the llvm-commits mailing list