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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 03:45:55 PDT 2020


grimar 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 &&
----------------
jhenderson wrote:
> 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?
Done.


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


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

https://reviews.llvm.org/D75342





More information about the llvm-commits mailing list