diff options
author | George Rimar <grimar@accesssoftek.com> | 2019-07-11 12:59:29 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2019-07-11 12:59:29 +0000 |
commit | eb41f7f081a8e9e20e3cb559c181c1097f94216f (patch) | |
tree | bc62810c9b39459210e0e5872c784a3abcfb0021 /llvm/lib/ObjectYAML | |
parent | e195a91d2d6ac9322a4d8899611b4bfd49cadd6c (diff) | |
download | bcm5719-llvm-eb41f7f081a8e9e20e3cb559c181c1097f94216f.tar.gz bcm5719-llvm-eb41f7f081a8e9e20e3cb559c181c1097f94216f.zip |
[yaml2obj] - Allow overriding the sh_size field.
There is no way to set broken sh_size field currently
for sections. It can be usefull for writing the
test cases.
Differential revision: https://reviews.llvm.org/D64401
llvm-svn: 365766
Diffstat (limited to 'llvm/lib/ObjectYAML')
-rw-r--r-- | llvm/lib/ObjectYAML/ELFYAML.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp index d968351bca9..7497154c757 100644 --- a/llvm/lib/ObjectYAML/ELFYAML.cpp +++ b/llvm/lib/ObjectYAML/ELFYAML.cpp @@ -913,11 +913,13 @@ static void commonSectionMapping(IO &IO, ELFYAML::Section &Section) { IO.mapOptional("AddressAlign", Section.AddressAlign, Hex64(0)); IO.mapOptional("EntSize", Section.EntSize); - // obj2yaml does not dump this field. It is expected to be empty when we are - // producing YAML, because yaml2obj sets an appropriate value for sh_offset - // automatically when it is not explicitly defined. - assert(!IO.outputting() || !Section.ShOffset.hasValue()); + // obj2yaml does not dump these fields. They are expected to be empty when we + // are producing YAML, because yaml2obj sets appropriate values for sh_offset + // and sh_size automatically when they are not explicitly defined. + assert(!IO.outputting() || + (!Section.ShOffset.hasValue() && !Section.ShSize.hasValue())); IO.mapOptional("ShOffset", Section.ShOffset); + IO.mapOptional("ShSize", Section.ShSize); } static void sectionMapping(IO &IO, ELFYAML::DynamicSection &Section) { |