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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 00:06:58 PDT 2022


jhenderson requested changes to this revision.
jhenderson added a comment.
This revision now requires changes to proceed.

Behaviour change is generally fine, but there are a couple of test changes/additions required.



================
Comment at: llvm/test/tools/llvm-readobj/ELF/many-sections.s:45
-# GNU2-NEXT:   [Nr] Name Type Address Off Size ES Flg Lk Inf Al
-# GNU2-NEXT:  warning: '[[FILE]]': e_shstrndx == SHN_XINDEX, but the section header table is empty
-# GNU2-NEXT:  Key to Flags:
----------------
Isn't this warning still expected to be emitted?


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4069-4072
+  if (Sections.size() == 0) {
+    OS << "\nThere are no sections in this file.\n";
+    return;
+  }
----------------
Seems like this case isn't tested?


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