[PATCH] D57365: [llvm-readobj] Add a flag to dump just the section-to-segment mapping.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 29 09:21:37 PST 2019


rupprecht added inline comments.


================
Comment at: llvm/tools/llvm-readobj/llvm-readobj.cpp:466-467
     Dumper->printFileHeaders();
+  if (opts::SectionMapping)
+    Dumper->printSectionMapping();
   if (opts::SectionHeaders)
----------------
jhenderson wrote:
> One thing I think we want to avoid is printing this mapping separately if `--section-mapping` and `--program-headers` are both specified.
> 
> Also, my gut feeling is that the output would be easier to read for `--section-headers --section-mapping`, if the section mapping appears after the section headers, but I don't feel strongly about it.
> 
> Perhaps any ordering inconsistency could be solved by moving this to immediately after `printProgramHeaders`?
+1, to both those points

Alternatively, maybe //don't// call printSectionMapping() from within printProgramHeaders(), but instead have opts::ProgramHeaders imply opts::SectionMapping, and make sure to call printSectionMapping() right after printProgramHeaders().

Also worth considering is if you want to handle "--program-headers --section-mapping=false" differently. Not sure it's necessary to handle that.


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

https://reviews.llvm.org/D57365





More information about the llvm-commits mailing list