summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-03-22 13:57:16 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-03-22 13:57:16 +0000
commitf4b9da62864867972da7014f60fdb1c8cb49c29c (patch)
tree6a85e0ebc6f137b9309237bda18e930d35b69a1e
parentccd9f4f4c7497f78b125d42b7c9c4bb38676a4e6 (diff)
downloadbcm5719-llvm-f4b9da62864867972da7014f60fdb1c8cb49c29c.tar.gz
bcm5719-llvm-f4b9da62864867972da7014f60fdb1c8cb49c29c.zip
Set the default type for .bss.foo.
This matches gas and is part of pr31888. llvm-svn: 298506
-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