[PATCH] D92636: [llvm-readelf/obj] - Improve diagnostics when printing NT_FILE notes.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 01:51:09 PST 2020


jhenderson added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:5576
+    for (const typename ELFT::Note Note : Obj.notes(P, Err)) {
+      ++Index;
+      if (Error E = ProcessNoteFn(Note))
----------------
grimar wrote:
> rupprecht wrote:
> > `Index` should probably be incremented at the end, otherwise it reports the first note as index 1, not index 0.
> This is intentional. We enumerate program headers (few lines above) starting from 1 too.
> And we do the same when printing warnings for relocations (in ` DumpStyle<ELFT>::forEachRelocationDo`).
Seems to me like this is inconsistent with our indexes elsewhere (where we index from 0). We should probably fix both cases here.


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

https://reviews.llvm.org/D92636



More information about the llvm-commits mailing list