virtual ~TargetAsmInfo();
const Section* getNamedSection(const char *Name,
- unsigned Flags = SectionFlags::None) const;
+ unsigned Flags = SectionFlags::None,
+ bool Override = false) const;
const Section* getUnnamedSection(const char *Directive,
- unsigned Flags = SectionFlags::None) const;
+ unsigned Flags = SectionFlags::None,
+ bool Override = false) const;
/// Measure the specified inline asm to determine an approximation of its
/// length.
ConstantPoolSection = "\t.section \".rodata\",#alloc\n";
COMMDirectiveTakesAlignment = true;
CStringSection=".rodata.str";
+
+ // Sparc normally uses named section for BSS.
+ BSSSection_ = getNamedSection("\t.bss",
+ SectionFlags::Writeable | SectionFlags::BSS,
+ /* Override */ true);
}
std::string SparcELFTargetAsmInfo::printSectionFlags(unsigned flags) const {
}
const Section*
-TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags) const {
+TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags,
+ bool Override) const {
Section& S = Sections[Name];
// This is newly-created section, set it up properly.
- if (S.Flags == SectionFlags::Invalid) {
+ if (S.Flags == SectionFlags::Invalid || Override) {
S.Flags = Flags | SectionFlags::Named;
S.Name = Name;
}
}
const Section*
-TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags) const {
+TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags,
+ bool Override) const {
Section& S = Sections[Directive];
// This is newly-created section, set it up properly.
- if (S.Flags == SectionFlags::Invalid) {
+ if (S.Flags == SectionFlags::Invalid || Override) {
S.Flags = Flags & ~SectionFlags::Named;
S.Name = Directive;
}