730c730,731
< if (LSDASection->getKind().isWriteable() ||
---
> if ((LSDASection->getKind().isWriteable() &&
> !LSDASection->getKind().isReadOnlyWithRel()) ||
919a921,923
> const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
> unsigned Index = 1;
>
922,923c926
< const GlobalVariable *GV = *I;
< PrintRelDirective();
---
> const GlobalVariable *TI = *I;
925,926c928,948
< if (GV) {
< O << Asm->Mang->getMangledName(GV);
---
> if (TI) {
> if (!LSDASection->getKind().isReadOnlyWithRel() &&
> (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);
> }
927a950
> PrintRelDirective();
< if (LSDASection->getKind().isWriteable() ||
---
> if ((LSDASection->getKind().isWriteable() &&
> !LSDASection->getKind().isReadOnlyWithRel()) ||
919a921,923
> const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
> unsigned Index = 1;
>
922,923c926
< const GlobalVariable *GV = *I;
< PrintRelDirective();
---
> const GlobalVariable *TI = *I;
925,926c928,948
< if (GV) {
< O << Asm->Mang->getMangledName(GV);
---
> if (TI) {
> if (!LSDASection->getKind().isReadOnlyWithRel() &&
> (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);
> }
927a950
> PrintRelDirective();