summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/MC/MCParser/ELFAsmParser.cpp2
-rw-r--r--llvm/test/MC/AsmParser/section_names.s8
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
index 5d24e3b3501..63b1dd081a2 100644
--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -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")
diff --git a/llvm/test/MC/AsmParser/section_names.s b/llvm/test/MC/AsmParser/section_names.s
index d843e3cc567..a7ba535ea13 100644
--- a/llvm/test/MC/AsmParser/section_names.s
+++ b/llvm/test/MC/AsmParser/section_names.s
@@ -32,6 +32,10 @@
.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
OpenPOWER on IntegriCloud