From fd559b198f27a09957cab0cf289c17948e7d279b Mon Sep 17 00:00:00 2001 From: rdivacky Date: Mon, 18 Aug 2014 18:05:55 +0000 Subject: Backport r197824, r213427 and r213960 from LLVM trunk: r197824 | rdivacky | 2013-12-20 19:08:54 +0100 (Fri, 20 Dec 2013) | 2 lines Implement initial-exec TLS for PPC32. r213427 | hfinkel | 2014-07-19 01:29:49 +0200 (Sat, 19 Jul 2014) | 7 lines [PowerPC] 32-bit ELF PIC support This adds initial support for PPC32 ELF PIC (Position Independent Code; the -fPIC variety), thus rectifying a long-standing deficiency in the PowerPC backend. Patch by Justin Hibbits! r213960 | hfinkel | 2014-07-25 19:47:22 +0200 (Fri, 25 Jul 2014) | 3 lines [PowerPC] Support TLS on PPC32/ELF Patch by Justin Hibbits! Reviewed by: jhibbits Approved by: dim --- contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp') diff --git a/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp b/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp index 6a0aec8..027ae3e 100644 --- a/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp +++ b/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp @@ -8,8 +8,16 @@ //===----------------------------------------------------------------------===// #include "PPCMachineFunctionInfo.h" +#include "llvm/MC/MCAsmInfo.h" +#include "llvm/MC/MCContext.h" +#include "llvm/Target/TargetMachine.h" using namespace llvm; void PPCFunctionInfo::anchor() { } +MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const { + const MCAsmInfo *MAI = MF.getTarget().getMCAsmInfo(); + return MF.getContext().GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix())+ + Twine(MF.getFunctionNumber())+"$poff"); +} -- cgit v1.1