[yaml2obj/obj2yaml] - Make RawContentSection::Content and RawContentSection::Size...
authorGeorge Rimar <grimar@accesssoftek.com>
Mon, 10 Jun 2019 12:43:18 +0000 (12:43 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Mon, 10 Jun 2019 12:43:18 +0000 (12:43 +0000)
commit1e41007aeba071d1a30f1f0eb7ebfe41f75917fb
tree7be126a2c5b55277db11eeda19ee307a68d82d1c
parent1f73bbbd3a5bbe4baec841f20ac237011716fbdd
[yaml2obj/obj2yaml] - Make RawContentSection::Content and RawContentSection::Size optional

This is a follow-up for D62809.

Content and Size fields should be optional as was discussed in comments
of the D62809's thread. With that, we can describe a specific string table and
symbol table sections in a more correct way and also show appropriate errors.

The patch adds lots of test cases where the behavior is described in details.

Differential revision: https://reviews.llvm.org/D62957

llvm-svn: 362931
llvm/include/llvm/ObjectYAML/ELFYAML.h
llvm/lib/ObjectYAML/ELFYAML.cpp
llvm/test/Object/obj2yaml.test
llvm/test/Object/yaml2obj-elf-section-invalid-size.yaml
llvm/test/tools/obj2yaml/elf-shinfo.yaml
llvm/test/tools/yaml2obj/dynsymtab-implicit-sections-size-content.yaml [new file with mode: 0644]
llvm/test/tools/yaml2obj/section-size-content.yaml [new file with mode: 0644]
llvm/test/tools/yaml2obj/strtab-implicit-sections-size-content.yaml [new file with mode: 0644]
llvm/test/tools/yaml2obj/symtab-implicit-sections-size-content.yaml [new file with mode: 0644]
llvm/tools/obj2yaml/elf2yaml.cpp
llvm/tools/yaml2obj/yaml2elf.cpp