X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FMC%2FMCSectionELF.cpp;h=5a0bb7fe986fb39518425721aefb83d14a360f38;hb=ce0413b05c392776df8742f60734c89f35150f59;hp=fb364c87a034dd15ebf42cf7e225dc326ffb42e3;hpb=9936b80df5a766d645131b84fb1ab6b131f5ba58;p=oota-llvm.git diff --git a/lib/MC/MCSectionELF.cpp b/lib/MC/MCSectionELF.cpp index fb364c87a03..5a0bb7fe986 100644 --- a/lib/MC/MCSectionELF.cpp +++ b/lib/MC/MCSectionELF.cpp @@ -24,12 +24,10 @@ MCSectionELF::~MCSectionELF() {} // anchor. bool MCSectionELF::ShouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const { - // FIXME: Does .section .bss/.data/.text work everywhere?? - if (Name == ".text" || Name == ".data" || - (Name == ".bss" && !MAI.usesELFSectionDirectiveForBSS())) - return true; + if (isUnique()) + return false; - return false; + return MAI.shouldOmitSectionDirective(Name); } static void printName(raw_ostream &OS, StringRef Name) { @@ -61,8 +59,10 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, if (ShouldOmitSectionDirective(SectionName, MAI)) { OS << '\t' << getSectionName(); - if (Subsection) - OS << '\t' << *Subsection; + if (Subsection) { + OS << '\t'; + Subsection->print(OS, &MAI); + } OS << '\n'; return; } @@ -133,6 +133,8 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, OS << "note"; else if (Type == ELF::SHT_PROGBITS) OS << "progbits"; + else if (Type == ELF::SHT_X86_64_UNWIND) + OS << "unwind"; if (EntrySize) { assert(Flags & ELF::SHF_MERGE); @@ -144,10 +146,17 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, printName(OS, Group->getName()); OS << ",comdat"; } + + if (isUnique()) + OS << ",unique," << UniqueID; + OS << '\n'; - if (Subsection) - OS << "\t.subsection\t" << *Subsection << '\n'; + if (Subsection) { + OS << "\t.subsection\t"; + Subsection->print(OS, &MAI); + OS << '\n'; + } } bool MCSectionELF::UseCodeAlign() const {