[PATCH] D75342: [obj2yaml] - Teach tool to dump program headers.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 02:38:10 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:299-300
+                        const typename ELFT::Phdr &Phdr) {
+  if (Sec.Type == ELF::SHT_NULL)
+    return false;
+  return SHdr.sh_offset >= Phdr.p_offset &&
----------------
Is it perhaps worth a test case that shows that SHT_NULL sections, even not the first one, are not considered to be inside a program header?


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:313-314
+    return PhdrsOrErr.takeError();
+  if (PhdrsOrErr->empty())
+    return Ret;
+
----------------
I'm not sure this early out is necessary. The subsequent for loop will not trigger, and `Ret` will be returned anyway, without modification.


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

https://reviews.llvm.org/D75342





More information about the llvm-commits mailing list