summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff options
context:
space:
mode:
authorStefan Pintilie <stefanp@ca.ibm.com>2018-11-16 19:24:23 +0000
committerStefan Pintilie <stefanp@ca.ibm.com>2018-11-16 19:24:23 +0000
commit9004444d815579e01c393553f598ffbe9da4564b (patch)
treef963857e760145859cf56c638ad821f95f3612eb /llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
parentcf2360fa8630d8d2c67ea3d4de75a3ca2df0b8e4 (diff)
downloadbcm5719-llvm-9004444d815579e01c393553f598ffbe9da4564b.tar.gz
bcm5719-llvm-9004444d815579e01c393553f598ffbe9da4564b.zip
Revert "[PowerPC] Make no-PIC default to match GCC - LLVM"
This reverts commit r347069 llvm-svn: 347076
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetMachine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
index d7eb9157b62..34410393ef6 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -214,7 +214,11 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT,
if (TT.isOSDarwin())
return Reloc::DynamicNoPIC;
- // Otherwise is static by default.
+ // Non-darwin 64-bit platforms are PIC by default.
+ if (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le)
+ return Reloc::PIC_;
+
+ // 32-bit is static by default.
return Reloc::Static;
}
OpenPOWER on IntegriCloud