OSDN Git Service

Set the default type for .bss.foo.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 22 Mar 2017 13:57:16 +0000 (13:57 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 22 Mar 2017 13:57:16 +0000 (13:57 +0000)
This matches gas and is part of pr31888.

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

lib/MC/MCParser/ELFAsmParser.cpp
test/MC/AsmParser/section_names.s

index 5d24e3b..63b1dd0 100644 (file)
@@ -571,6 +571,8 @@ EndStmt:
       Type = ELF::SHT_NOTE;
     else if (hasPrefix(SectionName, ".init_array."))
       Type = ELF::SHT_INIT_ARRAY;
+    else if (hasPrefix(SectionName, ".bss."))
+      Type = ELF::SHT_NOBITS;
     else if (SectionName == ".fini_array")
       Type = ELF::SHT_FINI_ARRAY;
     else if (SectionName == ".preinit_array")
index d843e3c..a7ba535 100644 (file)
 .byte 1
 .section .notefoo
 .byte 1
+.section .bss
+.space 1
+.section .bss.foo
+.space 1
 # CHECK:        Name: .nobits
 # CHECK-NEXT:   Type: SHT_PROGBITS
 # CHECK:        Name: .nobits2
@@ -64,3 +68,7 @@
 # CHECK-NEXT:   Type: SHT_NOTE
 # CHECK:        Name: .notefoo
 # CHECK-NEXT:   Type: SHT_NOTE
+# CHECK:        Name: .bss
+# CHECK-NEXT:   Type: SHT_NOBITS
+# CHECK:        Name: .bss.foo
+# CHECK-NEXT:   Type: SHT_NOBITS