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) {
if (ShouldOmitSectionDirective(SectionName, MAI)) {
OS << '\t' << getSectionName();
- if (Subsection)
- OS << '\t' << *Subsection;
+ if (Subsection) {
+ OS << '\t';
+ Subsection->print(OS, &MAI);
+ }
OS << '\n';
return;
}
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 {
bool MCSectionELF::isVirtualSection() const {
return getType() == ELF::SHT_NOBITS;
}
-
-unsigned MCSectionELF::DetermineEntrySize(SectionKind Kind) {
- if (Kind.isMergeable1ByteCString()) return 1;
- if (Kind.isMergeable2ByteCString()) return 2;
- if (Kind.isMergeable4ByteCString()) return 4;
- if (Kind.isMergeableConst4()) return 4;
- if (Kind.isMergeableConst8()) return 8;
- if (Kind.isMergeableConst16()) return 16;
- return 0;
-}