Skip to content

Commit

Permalink
[ELFYAML] Make the Size field for .bss section optional
Browse files Browse the repository at this point in the history
It's a common case to have a zero-size .bss section in an object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241352 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
atanasyan committed Jul 3, 2015
1 parent c97046c commit 5f78433
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Object/ELFYAML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ static void sectionMapping(IO &IO, ELFYAML::RawContentSection &Section) {

static void sectionMapping(IO &IO, ELFYAML::NoBitsSection &Section) {
commonSectionMapping(IO, Section);
IO.mapRequired("Size", Section.Size);
IO.mapOptional("Size", Section.Size, Hex64(0));
}

static void sectionMapping(IO &IO, ELFYAML::RelocationSection &Section) {
Expand Down
1 change: 0 additions & 1 deletion test/Object/obj2yaml.test
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ ELF-MIPS64EL-NEXT: - Name: .bss
ELF-MIPS64EL-NEXT: Type: SHT_NOBITS
ELF-MIPS64EL-NEXT: Flags: [ SHF_WRITE, SHF_ALLOC ]
ELF-MIPS64EL-NEXT: AddressAlign: 0x0000000000000010
ELF-MIPS64EL-NEXT: Size: 0x0000000000000000
ELF-MIPS64EL-NEXT: - Name: .MIPS.options
ELF-MIPS64EL-NEXT: Type: SHT_MIPS_OPTIONS
ELF-MIPS64EL-NEXT: Flags: [ SHF_ALLOC ]
Expand Down

0 comments on commit 5f78433

Please sign in to comment.