diff --git a/lib/MC/MCSectionELF.cpp b/lib/MC/MCSectionELF.cpp index 6e6f9990fe8..246bf4adac8 100644 --- a/lib/MC/MCSectionELF.cpp +++ b/lib/MC/MCSectionELF.cpp @@ -27,9 +27,9 @@ bool MCSectionELF::ShouldOmitSectionDirective(const char *Name, const TargetAsmInfo &TAI) const { // FIXME: Does .section .bss/.data/.text work everywhere?? - if (strncmp(Name, ".text", 5) == 0 || - strncmp(Name, ".data", 5) == 0 || - (strncmp(Name, ".bss", 4) == 0 && + if (strcmp(Name, ".text") == 0 || + strcmp(Name, ".data") == 0 || + (strcmp(Name, ".bss") == 0 && !TAI.usesELFSectionDirectiveForBSS())) return true;