Reverting the EH table patches.

$ svn merge -c -89279 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r89279 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp
U    lib/Target/TargetLoweringObjectFile.cpp
$ svn merge -c -89270 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r89270 into '.':
G    lib/CodeGen/AsmPrinter/DwarfException.cpp
G    lib/Target/TargetLoweringObjectFile.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89379 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2009-11-19 19:21:09 +00:00
parent 5c376ff9f0
commit fb7634f1c7
2 changed files with 7 additions and 30 deletions

View File

@ -727,8 +727,7 @@ void DwarfException::EmitExceptionTable() {
// somewhere. This predicate should be moved to a shared location that is // somewhere. This predicate should be moved to a shared location that is
// in target-independent code. // in target-independent code.
// //
if ((LSDASection->getKind().isWriteable() && if (LSDASection->getKind().isWriteable() ||
!LSDASection->getKind().isReadOnlyWithRel()) ||
Asm->TM.getRelocationModel() == Reloc::Static) Asm->TM.getRelocationModel() == Reloc::Static)
TTypeFormat = dwarf::DW_EH_PE_absptr; TTypeFormat = dwarf::DW_EH_PE_absptr;
else else
@ -918,36 +917,14 @@ void DwarfException::EmitExceptionTable() {
} }
// Emit the Catch TypeInfos. // Emit the Catch TypeInfos.
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
unsigned Index = 1;
for (std::vector<GlobalVariable *>::const_reverse_iterator for (std::vector<GlobalVariable *>::const_reverse_iterator
I = TypeInfos.rbegin(), E = TypeInfos.rend(); I != E; ++I) { I = TypeInfos.rbegin(), E = TypeInfos.rend(); I != E; ++I) {
const GlobalVariable *TI = *I; const GlobalVariable *GV = *I;
PrintRelDirective();
if (TI) { if (GV) {
if (!LSDASection->getKind().isReadOnlyWithRel() && O << Asm->Mang->getMangledName(GV);
(TTypeFormat == dwarf::DW_EH_PE_absptr ||
TI->getLinkage() == GlobalValue::InternalLinkage)) {
// Print out the unadorned name of the type info.
PrintRelDirective();
O << Asm->Mang->getMangledName(TI);
} else {
bool IsTypeInfoIndirect = false, IsTypeInfoPCRel = false;
const MCExpr *TypeInfoRef =
TLOF.getSymbolForDwarfGlobalReference(TI, Asm->Mang, Asm->MMI,
IsTypeInfoIndirect,
IsTypeInfoPCRel);
if (!IsTypeInfoPCRel)
TypeInfoRef = CreateLabelDiff(TypeInfoRef, "typeinforef_addr",
Index++);
O << MAI->getData32bitsDirective();
TypeInfoRef->print(O, MAI);
}
} else { } else {
PrintRelDirective();
O << "0x0"; O << "0x0";
} }

View File

@ -783,8 +783,8 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
} }
// Exception Handling. // Exception Handling.
LSDASection = getMachOSection("__TEXT", "__gcc_except_tab", 0, LSDASection = getMachOSection("__DATA", "__gcc_except_tab", 0,
SectionKind::getReadOnlyWithRel()); SectionKind::getDataRel());
EHFrameSection = EHFrameSection =
getMachOSection("__TEXT", "__eh_frame", getMachOSection("__TEXT", "__eh_frame",
MCSectionMachO::S_COALESCED | MCSectionMachO::S_COALESCED |