diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 43 | ||||
-rw-r--r-- | lib/MC/ELFObjectWriter.cpp | 1 | ||||
-rw-r--r-- | lib/MC/MCParser/ELFAsmParser.cpp | 2 | ||||
-rw-r--r-- | lib/Target/TargetLoweringObjectFile.cpp | 1 |
4 files changed, 26 insertions, 21 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 934a26ea82..5a0e2cfa30 100644 --- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -134,11 +134,6 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx, getContext().getELFSection(".gcc_except_table", ELF::SHT_PROGBITS, ELF::SHF_ALLOC, SectionKind::getReadOnly()); - EHFrameSection = - getContext().getELFSection(".eh_frame", ELF::SHT_PROGBITS, - ELF::SHF_ALLOC, - SectionKind::getDataRel()); - // Debug Info Sections. DwarfAbbrevSection = getContext().getELFSection(".debug_abbrev", ELF::SHT_PROGBITS, 0, @@ -175,6 +170,11 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx, SectionKind::getMetadata()); } +const MCSection *TargetLoweringObjectFileELF::getEHFrameSection() const { + return getContext().getELFSection(".eh_frame", ELF::SHT_PROGBITS, + ELF::SHF_ALLOC, + SectionKind::getDataRel()); +} static SectionKind getELFKindForNamedSection(StringRef Name, SectionKind K) { @@ -581,14 +581,6 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx, // Exception Handling. LSDASection = getContext().getMachOSection("__TEXT", "__gcc_except_tab", 0, SectionKind::getReadOnlyWithRel()); - EHFrameSection = - getContext().getMachOSection("__TEXT", "__eh_frame", - MCSectionMachO::S_COALESCED | - MCSectionMachO::S_ATTR_NO_TOC | - MCSectionMachO::S_ATTR_STRIP_STATIC_SYMS | - MCSectionMachO::S_ATTR_LIVE_SUPPORT, - SectionKind::getReadOnly()); - // Debug Information. DwarfAbbrevSection = getContext().getMachOSection("__DWARF", "__debug_abbrev", @@ -642,6 +634,15 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx, TLSExtraDataSection = TLSTLVSection; } +const MCSection *TargetLoweringObjectFileMachO::getEHFrameSection() const { + return getContext().getMachOSection("__TEXT", "__eh_frame", + MCSectionMachO::S_COALESCED | + MCSectionMachO::S_ATTR_NO_TOC | + MCSectionMachO::S_ATTR_STRIP_STATIC_SYMS | + MCSectionMachO::S_ATTR_LIVE_SUPPORT, + SectionKind::getReadOnly()); +} + const MCSection *TargetLoweringObjectFileMachO:: getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const { @@ -873,13 +874,6 @@ void TargetLoweringObjectFileCOFF::Initialize(MCContext &Ctx, COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ, SectionKind::getReadOnly()); - EHFrameSection = - getContext().getCOFFSection(".eh_frame", - COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | - COFF::IMAGE_SCN_MEM_READ | - COFF::IMAGE_SCN_MEM_WRITE, - SectionKind::getDataRel()); - // Debug info. DwarfAbbrevSection = getContext().getCOFFSection(".debug_abbrev", @@ -943,6 +937,15 @@ void TargetLoweringObjectFileCOFF::Initialize(MCContext &Ctx, SectionKind::getMetadata()); } +const MCSection *TargetLoweringObjectFileCOFF::getEHFrameSection() const { + return getContext().getCOFFSection(".eh_frame", + COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | + COFF::IMAGE_SCN_MEM_READ | + COFF::IMAGE_SCN_MEM_WRITE, + SectionKind::getDataRel()); +} + + static unsigned getCOFFSectionFlags(SectionKind K) { unsigned Flags = 0; diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 77e078baf8..05dd0c7629 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -1271,6 +1271,7 @@ void ELFObjectWriter::WriteSection(MCAssembler &Asm, case ELF::SHT_INIT_ARRAY: case ELF::SHT_FINI_ARRAY: case ELF::SHT_PREINIT_ARRAY: + case ELF::SHT_X86_64_UNWIND: // Nothing to do. break; diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp index 200aa5fed3..39ff906ea7 100644 --- a/lib/MC/MCParser/ELFAsmParser.cpp +++ b/lib/MC/MCParser/ELFAsmParser.cpp @@ -338,6 +338,8 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) { Type = ELF::SHT_PROGBITS; else if (TypeName == "note") Type = ELF::SHT_NOTE; + else if (TypeName == "unwind") + Type = ELF::SHT_X86_64_UNWIND; else return TokError("unknown section type"); } diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index 681beec636..5d34c7d7fa 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/lib/Target/TargetLoweringObjectFile.cpp @@ -43,7 +43,6 @@ TargetLoweringObjectFile::TargetLoweringObjectFile() : Ctx(0) { StaticCtorSection = 0; StaticDtorSection = 0; LSDASection = 0; - EHFrameSection = 0; CommDirectiveSupportsAlignment = true; DwarfAbbrevSection = 0; |