and use PersonalityPrefix/Suffix to achieve the same effect (like
the x86 backend).
This changes the code generated for ppc static mode, but guess what,
we were generating this before:
.byte 0x9B ; Personality (indirect pcrel sdata4)
.long ___gxx_personality_v0-. ; Personality
which is not correct! (it is not an 'indirect' reference).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81965
91177308-0d34-0410-b5e6-
96231b3b80d8
const char *Modifier);
virtual bool runOnMachineFunction(MachineFunction &F) = 0;
-
- virtual void EmitExternalGlobal(const GlobalVariable *GV);
};
/// PPCLinuxAsmPrinter - PowerPC assembly printer, customized for Linux
}
}
-/// EmitExternalGlobal - In this case we need to use the indirect symbol.
-///
-void PPCAsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) {
- std::string Name;
-
- if (TM.getRelocationModel() != Reloc::Static) {
- Name = Mang->getMangledName(GV, "$non_lazy_ptr", true);
- } else {
- Name = Mang->getMangledName(GV);
- }
- O << Name;
-}
-
/// PrintAsmOperand - Print out an operand for an inline asm expression.
///
bool PPCAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
if (!is64Bit)
Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
AssemblerDialect = 1; // New-Style mnemonics.
+
+ PersonalityPrefix = "L";
+ PersonalitySuffix = "$non_lazy_ptr";
}
PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {