[PATCH] D130670: [llvm-readelf] Render messages similar to that of `GNU binutils readelf` when no sections and/or no headers.

Prabhu Karthikeyan Rajasekaran via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 09:43:47 PDT 2022


Prabhuk marked 6 inline comments as done.
Prabhuk added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/no-phdrs.test:11
 
-# GNU:       There are 0 program headers
-# GNU:       Program Headers:
-# GNU-NEXT:    Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
-# GNU-EMPTY:
-# GNU-NEXT:  Section to Segment mapping:
-# GNU-NEXT:    Segment Sections...
-# GNU-NEXT:     None   .strtab .shstrtab
+# GNU:       There are no program headers in this file.
 
----------------
jhenderson wrote:
> Prabhuk wrote:
> > jhenderson wrote:
> > > I think we need to show that the section segment mapping is not printed in this case. I'm thinking something like `GNU-NOT: {{.}}` or better yet, `--implicit-check-not={{.}}` should do the trick.
> > Once again there was an error in this work flow. Clean up of "Program Headers" section was intended. But the Section to Segment mapping was not intended to be changed so bringing that part back.
> So just to confirm, GNU prints the (empty) section to segment mapping even if there are no program headers, when the program headers are dumped?
That's correct! When we ask to dump program headers we dump section to segment mapping by default. Showing empty mapping  offers users consistency on what to expect in the output printed to the console imo. But I could go either way (show empty mapping or not) to be honest.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130670



More information about the llvm-commits mailing list