[PowerPC] Support TLS variables in debug info
[oota-llvm.git] / lib / Target / PowerPC / PPCTargetObjectFile.cpp
index 90e4f1545250472819c118d42af6244bf36c20ce..ec1e606eee56fa32ed1d7ce1d73b3236e78f52d2 100644 (file)
@@ -55,3 +55,13 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
 
   return DefaultSection;
 }
+
+const MCExpr *PPC64LinuxTargetObjectFile::
+getDebugThreadLocalSymbol(const MCSymbol *Sym) const {
+  const MCExpr *Expr =
+    MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_PPC_DTPREL, getContext());
+  return MCBinaryExpr::CreateAdd(Expr,
+                                 MCConstantExpr::Create(0x8000, getContext()),
+                                 getContext());
+}
+