From: Rafael Espindola Date: Wed, 22 Mar 2017 13:57:16 +0000 (+0000) Subject: Set the default type for .bss.foo. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e67048abe7d417a5aa10da3868cc0b76daa2627f;p=llvm Set the default type for .bss.foo. 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 --- diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp index 5d24e3b3501..63b1dd081a2 100644 --- a/lib/MC/MCParser/ELFAsmParser.cpp +++ b/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/test/MC/AsmParser/section_names.s b/test/MC/AsmParser/section_names.s index d843e3cc567..a7ba535ea13 100644 --- a/test/MC/AsmParser/section_names.s +++ b/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