Add Support For .bss Named Section Directive For Darwin Targets.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 2 Oct 2013 14:09:29 +0000 (14:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 2 Oct 2013 14:09:29 +0000 (14:09 +0000)
Patch by Nicholas White.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191824 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/DarwinAsmParser.cpp

index f08270c15287eafbdf7289c0f4eb7dd230e18964..4c9bafa76effc661887e4a634455b2bb030be22d 100644 (file)
@@ -71,6 +71,7 @@ public:
       ".end_data_region");
 
     // Special section directives.
+    addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveBss>(".bss");
     addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveConst>(".const");
     addDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveConstData>(
       ".const_data");
@@ -182,6 +183,10 @@ public:
   bool ParseDirectiveDataRegionEnd(StringRef, SMLoc);
 
   // Named Section Directive
+  bool ParseSectionDirectiveBss(StringRef, SMLoc) {
+    return ParseSectionSwitch("__DATA", "__bss");
+  }
+
   bool ParseSectionDirectiveConst(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT", "__const");
   }