[llvm] r298506 - Set the default type for .bss.foo.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 06:57:16 PDT 2017
Author: rafael
Date: Wed Mar 22 08:57:16 2017
New Revision: 298506
URL: http://llvm.org/viewvc/llvm-project?rev=298506&view=rev
Log:
Set the default type for .bss.foo.
This matches gas and is part of pr31888.
Modified:
llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
llvm/trunk/test/MC/AsmParser/section_names.s
Modified: llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp?rev=298506&r1=298505&r2=298506&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp Wed Mar 22 08:57:16 2017
@@ -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")
Modified: llvm/trunk/test/MC/AsmParser/section_names.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/section_names.s?rev=298506&r1=298505&r2=298506&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/section_names.s (original)
+++ llvm/trunk/test/MC/AsmParser/section_names.s Wed Mar 22 08:57:16 2017
@@ -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
More information about the llvm-commits
mailing list