[llvm] r241352 - [ELFYAML] Make the Size field for .bss section optional
Simon Atanasyan
simon at atanasyan.com
Fri Jul 3 07:19:06 PDT 2015
Author: atanasyan
Date: Fri Jul 3 09:19:06 2015
New Revision: 241352
URL: http://llvm.org/viewvc/llvm-project?rev=241352&view=rev
Log:
[ELFYAML] Make the Size field for .bss section optional
It's a common case to have a zero-size .bss section in an object file.
Modified:
llvm/trunk/lib/Object/ELFYAML.cpp
llvm/trunk/test/Object/obj2yaml.test
Modified: llvm/trunk/lib/Object/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFYAML.cpp?rev=241352&r1=241351&r2=241352&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELFYAML.cpp (original)
+++ llvm/trunk/lib/Object/ELFYAML.cpp Fri Jul 3 09:19:06 2015
@@ -629,7 +629,7 @@ static void sectionMapping(IO &IO, ELFYA
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) {
Modified: llvm/trunk/test/Object/obj2yaml.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/obj2yaml.test?rev=241352&r1=241351&r2=241352&view=diff
==============================================================================
--- llvm/trunk/test/Object/obj2yaml.test (original)
+++ llvm/trunk/test/Object/obj2yaml.test Fri Jul 3 09:19:06 2015
@@ -324,7 +324,6 @@ ELF-MIPS64EL-NEXT: - Name:
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 ]
More information about the llvm-commits
mailing list