[PATCH] D78709: [llvm-readobj] - Simplify conditions used for printing segment mappings. NFCI.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 03:13:10 PDT 2020


grimar marked 3 inline comments as done.
grimar added a comment.

I've read all the comments and I have no answers for many of them atm.
(I am at the begining of investigating/understanding the logic we have. It looks messy.
This patch is the first step that reveals the conditions we have to document/test them).

Currently I am working on a patch to document the existent behavior.
I am going to investigate the conditions, GNU readelf behavior and probably it's code.
Hopefully it will help to understand and answer the questions that were asked.
It will take some time, I'll return here after posting it.

After landing this and the patch mentioned we will be able to clean-up/improve the logic.
(I am in fear of making any non-trivial changes/cleanups while we have no solid test coverage).



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4083
+
+  // No section with zero size must be at the start or at the end of PT_DYNAMIC.
   return ((Sec.sh_type == ELF::SHT_NOBITS) ||
----------------
jhenderson wrote:
> This comment belongs with the above if, I think.
I think no. It seems to be about 

"(Sec.sh_offset > Phdr.p_offset && Sec.sh_offset < Phdr.p_offset + Phdr.p_filesz)"

One of conditions to get here is to have "Sec.sh_size == 0".


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

https://reviews.llvm.org/D78709





More information about the llvm-commits mailing list