[PATCH] [lld][ELF][x86-64] Implement static relocation model for TLS.

Michael Spencer bigcheesegs at gmail.com
Thu Jan 31 15:57:56 PST 2013



================
Comment at: lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp:87-93
@@ -85,4 +86,9 @@
     }
-    int32_t result = (int32_t)(targetVAddress - _tlsSize);
-    *reinterpret_cast<llvm::support::little32_t *>(location) = result;
+    if (ref.kind() == R_X86_64_TPOFF32) {
+      int32_t result = (int32_t)(targetVAddress - _tlsSize);
+      *reinterpret_cast<llvm::support::little32_t *>(location) = result;
+    } else {
+      int64_t result = (int64_t)(targetVAddress - _tlsSize);
+      *reinterpret_cast<llvm::support::little64_t *>(location) = result;
+    }
     break;
----------------
Shankar Kalpathi Easwaran wrote:
> Should the location contents be or'ed or added  here ?
No.

================
Comment at: lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.cpp:35
@@ -35,2 +34,3 @@
 
-  virtual StringRef name() const { return "ELF-GOTAtom"; }
+  virtual StringRef name() const { return ""; }
+
----------------
Shankar Kalpathi Easwaran wrote:
> For debugging it could return got.<symbolname> ?
Sure.

================
Comment at: lib/ReaderWriter/ELF/X86_64/X86_64TargetInfo.cpp:65
@@ -62,2 +64,3 @@
 
-  virtual StringRef name() const { return "ELF-PLTAtom"; }
+  virtual StringRef name() const { return ""; }
+
----------------
Shankar Kalpathi Easwaran wrote:
> Same here ?
k


http://llvm-reviews.chandlerc.com/D361



More information about the llvm-commits mailing list