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

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 29 09:32:16 PST 2019


mattd marked an inline comment as done.
mattd added inline comments.


================
Comment at: llvm/tools/llvm-readobj/llvm-readobj.cpp:466-467
     Dumper->printFileHeaders();
+  if (opts::SectionMapping)
+    Dumper->printSectionMapping();
   if (opts::SectionHeaders)
----------------
rupprecht wrote:
> 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.
> 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().

I like that suggestion.  Thanks for the feedback.


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

https://reviews.llvm.org/D57365





More information about the llvm-commits mailing list