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 | 0ff6effb21071dfb4b99c02bbd743bd14cefab37 (patch) | |
tree | 08f88c07f62f402320663b559c9f558a75849877 /lib/MC | |
parent | 02f7bd5a38a6712f438cbee3cbcf7ef0b1f0618d (diff) | |
download | external_llvm-0ff6effb21071dfb4b99c02bbd743bd14cefab37.zip external_llvm-0ff6effb21071dfb4b99c02bbd743bd14cefab37.tar.gz external_llvm-0ff6effb21071dfb4b99c02bbd743bd14cefab37.tar.bz2 |
Remove HasCrazyBSS and add a flag in TAI to indicate that '.section'
must be emitted for PowerPC-Linux '.bss' section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCSectionELF.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/MC/MCSectionELF.cpp b/lib/MC/MCSectionELF.cpp index 56f8034..6e6f999 100644 --- a/lib/MC/MCSectionELF.cpp +++ b/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; } |