diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2013-07-02 18:47:35 +0000 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2013-07-02 18:47:35 +0000 |
commit | 0f0398246c1db77b9e113d449c29ec54b7e19cb4 (patch) | |
tree | 7d9abd60fce9d1775ae95dc3bdc2442e4a2dbef0 /llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp | |
parent | 2b6fc8d613c50dda7f60961a0c5a19b690b450b9 (diff) | |
download | llvm-0f0398246c1db77b9e113d449c29ec54b7e19cb4.zip llvm-0f0398246c1db77b9e113d449c29ec54b7e19cb4.tar.gz llvm-0f0398246c1db77b9e113d449c29ec54b7e19cb4.tar.bz2 |
[PowerPC] Support TLS variables in debug info
This adds an implementation of getDebugThreadLocalSymbol for
(64-bit) PowerPC. This needs to return a generic MCExpr
since on ppc64, we need to add a bias of 0x8000 to the
value returned by the R_PPC64_DTPREL64 relocation.
llvm-svn: 185461
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp index 90e4f15..ec1e606e 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()); +} + |