summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp10
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetObjectFile.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp
index 90e4f154525..ec1e606eee5 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp
@@ -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());
+}
+
diff --git a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h
index 9203e235742..262c52213d2 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h
+++ b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h
@@ -25,6 +25,9 @@ namespace llvm {
virtual const MCSection *
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler *Mang, const TargetMachine &TM) const;
+
+ /// \brief Describe a TLS variable address within debug info.
+ virtual const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const;
};
} // end namespace llvm
OpenPOWER on IntegriCloud