summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ObjectYAML/ELFYAML.cpp10
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) {
OpenPOWER on IntegriCloud