[yaml2obj][ELF] Add an optional `Size` field to the YAML section declaration.
[oota-llvm.git] / tools / obj2yaml / elf2yaml.cpp
index 38afa138d97d973a561990597884f0ab952e301b..7642921b4855d65983748794c9ca432ab35d161e 100644 (file)
@@ -254,6 +254,7 @@ ELFDumper<ELFT>::dumpContentSection(const Elf_Shdr *Shdr) {
   if (error_code EC = ContentOrErr.getError())
     return EC;
   S->Content = object::yaml::BinaryRef(ContentOrErr.get());
+  S->Size = S->Content.binary_size();
 
   return S.release();
 }