aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCISelLowering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-06 01:04:03 +0000
committerChris Lattner <sabre@nondot.org>2006-01-06 01:04:03 +0000
commita35ef6350defdc09eb912c52603cffa6afbd78e2 (patch)
treed2c31542dda0b973af941130b00cca30221d3a6a /lib/Target/PowerPC/PPCISelLowering.cpp
parentd9558e0ba6ddcf2798cfb88cc56e5f1c8135eb0d (diff)
linkonce symbols have an extra indirection, just like weak ones do. This fixes
Prolangs-C++/family and Prolangs-C++/primes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r--lib/Target/PowerPC/PPCISelLowering.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp
index 9547b9e9d4..9fb1a21125 100644
--- a/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -379,6 +379,7 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
// Only lower GlobalAddress on Darwin.
if (!getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) break;
+
SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, GA, Zero);
if (PICEnabled) {
// With PIC, the first instruction is actually "GR+hi(&G)".
@@ -389,7 +390,7 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
SDOperand Lo = DAG.getNode(PPCISD::Lo, MVT::i32, GA, Zero);
Lo = DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo);
- if (!GV->hasWeakLinkage() && !GV->isExternal())
+ if (!GV->hasWeakLinkage() && !GV->hasLinkOnceLinkage() && !GV->isExternal())
return Lo;
// If the global is weak or external, we have to go through the lazy