if (T.getArch() == Triple::aarch64)
return true;
+ // armv7k always has it.
+ if (T.isWatchOS())
+ return true;
+
// Use it on newer version of OS X.
if (T.isMacOSX() && !T.isMacOSXVersionLT(10, 6))
return true;
// MachO
SupportsWeakOmittedEHFrame = false;
+ EHFrameSection = Ctx->getMachOSection(
+ "__TEXT", "__eh_frame",
+ MachO::S_COALESCED | MachO::S_ATTR_NO_TOC |
+ MachO::S_ATTR_STRIP_STATIC_SYMS | MachO::S_ATTR_LIVE_SUPPORT,
+ SectionKind::getReadOnly());
+
if (T.isOSDarwin() && T.getArch() == Triple::aarch64)
SupportsCompactUnwindWithoutEHFrame = true;
+ if (T.isWatchOS())
+ OmitDwarfIfHaveCompactUnwind = true;
+
PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel
| dwarf::DW_EH_PE_sdata4;
LSDAEncoding = FDECFIEncoding = dwarf::DW_EH_PE_pcrel;
SectionKind::getReadOnly());
if (T.getArch() == Triple::x86_64 || T.getArch() == Triple::x86)
- CompactUnwindDwarfEHFrameOnly = 0x04000000;
+ CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_X86_64_MODE_DWARF
else if (T.getArch() == Triple::aarch64)
- CompactUnwindDwarfEHFrameOnly = 0x03000000;
+ CompactUnwindDwarfEHFrameOnly = 0x03000000; // UNWIND_ARM64_MODE_DWARF
+ else if (T.getArch() == Triple::arm || T.getArch() == Triple::thumb)
+ CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_ARM_MODE_DWARF
}
// Debug Information.
break;
}
+ unsigned EHSectionType = T.getArch() == Triple::x86_64
+ ? ELF::SHT_X86_64_UNWIND
+ : ELF::SHT_PROGBITS;
+
// Solaris requires different flags for .eh_frame to seemingly every other
// platform.
- EHSectionType = ELF::SHT_PROGBITS;
- EHSectionFlags = ELF::SHF_ALLOC;
- if (T.isOSSolaris()) {
- if (T.getArch() == Triple::x86_64)
- EHSectionType = ELF::SHT_X86_64_UNWIND;
- else
- EHSectionFlags |= ELF::SHF_WRITE;
- }
+ unsigned EHSectionFlags = ELF::SHF_ALLOC;
+ if (T.isOSSolaris() && T.getArch() != Triple::x86_64)
+ EHSectionFlags |= ELF::SHF_WRITE;
// ELF
BSSSection = Ctx->getELFSection(".bss", ELF::SHT_NOBITS,
FaultMapSection =
Ctx->getELFSection(".llvm_faultmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
+
+ EHFrameSection =
+ Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags);
}
void MCObjectFileInfo::initCOFFMCObjectFileInfo(Triple T) {
+ EHFrameSection = Ctx->getCOFFSection(
+ ".eh_frame", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getDataRel());
+
bool IsWoA = T.getArch() == Triple::arm || T.getArch() == Triple::thumb;
CommDirectiveSupportsAlignment = true;
CommDirectiveSupportsAlignment = true;
SupportsWeakOmittedEHFrame = true;
SupportsCompactUnwindWithoutEHFrame = false;
+ OmitDwarfIfHaveCompactUnwind = false;
PersonalityEncoding = LSDAEncoding = FDECFIEncoding = TTypeEncoding =
dwarf::DW_EH_PE_absptr;
return Ctx->getELFSection(".debug_types", ELF::SHT_PROGBITS, ELF::SHF_GROUP,
0, utostr(Hash));
}
-
-void MCObjectFileInfo::InitEHFrameSection() {
- if (Env == IsMachO)
- EHFrameSection =
- Ctx->getMachOSection("__TEXT", "__eh_frame",
- MachO::S_COALESCED |
- MachO::S_ATTR_NO_TOC |
- MachO::S_ATTR_STRIP_STATIC_SYMS |
- MachO::S_ATTR_LIVE_SUPPORT,
- SectionKind::getReadOnly());
- else if (Env == IsELF)
- EHFrameSection =
- Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags);
- else
- EHFrameSection =
- Ctx->getCOFFSection(".eh_frame",
- COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
- COFF::IMAGE_SCN_MEM_READ |
- COFF::IMAGE_SCN_MEM_WRITE,
- SectionKind::getDataRel());
-}