[PATCH] D57461: [obj2yaml] - Merge dumpRelSection and dumpRelaSection. NFC.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 31 04:53:08 PST 2019


jhenderson added a comment.

Basically looks fine, but I'd like the reordering done before I approve.



================
Comment at: tools/obj2yaml/elf2yaml.cpp:365
 
-  auto Rels = Obj.relas(Shdr);
-  if (!Rels)
-    return errorToErrorCode(Rels.takeError());
-  for (const Elf_Rela &Rel : *Rels) {
-    ELFYAML::Relocation R;
-    if (std::error_code EC = dumpRelocation(&Rel, SymTab, R))
-      return EC;
-    R.Addend = Rel.r_addend;
-    S->Relocations.push_back(R);
+  if (Shdr->sh_type == ELF::SHT_RELA) {
+    auto Rels = Obj.relas(Shdr);
----------------
This would probably line up better in diffs and history etc if you inverted this (i.e. do SHT_REL first, followed by SHT_RELA), since that matches the original function order.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57461/new/

https://reviews.llvm.org/D57461





More information about the llvm-commits mailing list