diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-08-13 23:30:21 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-08-13 23:30:21 +0000 |
commit | 62e6a8bbe68e4ca4c8284353909af008929c6192 (patch) | |
tree | 33c22856bf61f3009d280fea16ce9c14931c75ea /llvm/lib/MC/MCSectionELF.cpp | |
parent | c36edfede543cbe586a32fec9eb0035ea7715a6f (diff) | |
download | bcm5719-llvm-62e6a8bbe68e4ca4c8284353909af008929c6192.tar.gz bcm5719-llvm-62e6a8bbe68e4ca4c8284353909af008929c6192.zip |
Remove HasCrazyBSS and add a flag in TAI to indicate that '.section'
must be emitted for PowerPC-Linux '.bss' section
llvm-svn: 78958
Diffstat (limited to 'llvm/lib/MC/MCSectionELF.cpp')
-rw-r--r-- | llvm/lib/MC/MCSectionELF.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp index 56f803496ac..6e6f9990fe8 100644 --- a/llvm/lib/MC/MCSectionELF.cpp +++ b/llvm/lib/MC/MCSectionELF.cpp @@ -16,20 +16,21 @@ using namespace llvm; MCSectionELF *MCSectionELF:: Create(const StringRef &Section, unsigned Type, unsigned Flags, - SectionKind K, bool hasCrazyBSS, bool isExplicit, MCContext &Ctx) { + SectionKind K, bool isExplicit, MCContext &Ctx) { return new - (Ctx) MCSectionELF(Section, Type, Flags, K, hasCrazyBSS, isExplicit); + (Ctx) MCSectionELF(Section, Type, Flags, K, isExplicit); } // ShouldOmitSectionDirective - Decides whether a '.section' directive // should be printed before the section name -bool MCSectionELF::ShouldOmitSectionDirective(const char *Name) const { +bool MCSectionELF::ShouldOmitSectionDirective(const char *Name, + const TargetAsmInfo &TAI) const { - // PPC/Linux doesn't support the .bss directive, it needs .section .bss. // FIXME: Does .section .bss/.data/.text work everywhere?? - if ((!HasCrazyBSS && strncmp(Name, ".bss", 4) == 0) || - strncmp(Name, ".text", 5) == 0 || - strncmp(Name, ".data", 5) == 0) + if (strncmp(Name, ".text", 5) == 0 || + strncmp(Name, ".data", 5) == 0 || + (strncmp(Name, ".bss", 4) == 0 && + !TAI.usesELFSectionDirectiveForBSS())) return true; return false; @@ -46,8 +47,8 @@ bool MCSectionELF::ShouldPrintSectionType(unsigned Ty) const { void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI, raw_ostream &OS) const { - - if (ShouldOmitSectionDirective(SectionName.c_str())) { + + if (ShouldOmitSectionDirective(SectionName.c_str(), TAI)) { OS << '\t' << getSectionName() << '\n'; return; } |