[PATCH] D136636: [llvm-readelf] --section-details: display SHF_COMPRESSED headers

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 00:25:09 PDT 2022


jhenderson added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4196
+    if (!Data || Data->size() < sizeof(Elf_Chdr)) {
+      consumeError(Data.takeError());
+      OS << "[<corrupt>]";
----------------
MaskRay wrote:
> jhenderson wrote:
> > I'm wondering if we should report this error as a warning. It might help the user know why their section is corrupt, for example.
> The GNU behavior is `[<corrupt>]`. Do you suggest a separate warning beside the stdout output?  That may duplicate the information...
Yes, that's what I'm suggesting. For example, we already have in llvm-readelf warnings when the code can't read a section name, but we still print a placeholder for the name (e.g. `<no-strings>` in https://github.com/llvm/llvm-project/blob/main/llvm/test/tools/llvm-readobj/ELF/sections-no-section-header-string-table.test).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136636



More information about the llvm-commits mailing list