Skip to content

Commit

Permalink
Set the default type for .bss.foo.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
espindola committed Mar 22, 2017
1 parent 354d235 commit e67048a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/MC/MCParser/ELFAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
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")
Expand Down
8 changes: 8 additions & 0 deletions test/MC/AsmParser/section_names.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit e67048a

Please sign in to comment.