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
This commit is contained in:
Chris Lattner 2006-01-06 01:04:03 +00:00
parent d9558e0ba6
commit a35ef6350d

View File

@ -379,6 +379,7 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
// Only lower GlobalAddress on Darwin. // Only lower GlobalAddress on Darwin.
if (!getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) break; if (!getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin()) break;
SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, GA, Zero); SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, GA, Zero);
if (PICEnabled) { if (PICEnabled) {
// With PIC, the first instruction is actually "GR+hi(&G)". // 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); SDOperand Lo = DAG.getNode(PPCISD::Lo, MVT::i32, GA, Zero);
Lo = DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo); Lo = DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo);
if (!GV->hasWeakLinkage() && !GV->isExternal()) if (!GV->hasWeakLinkage() && !GV->hasLinkOnceLinkage() && !GV->isExternal())
return Lo; return Lo;
// If the global is weak or external, we have to go through the lazy // If the global is weak or external, we have to go through the lazy