[PATCH] D68705: [llvm-readelf/llvm-readobj] - Improve dumping of broken versioning sections.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 07:47:15 PDT 2019
grimar added inline comments.
================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:671
+ if ((ptrdiff_t)VernauxBuf % sizeof(uint32_t) != 0)
+ report_fatal_error("an auxiliary record found is misaligned");
+
----------------
jhenderson wrote:
> This and the other errors here shouldn't use `report_fatal_error`. They should use `reportError` or similar. I'm okay with that being a separate change, but perhaps it should be first to avoid adding another bad usage.
>
> The message could include more context, for example giving the offset or similar, so that a user might be able to identify the bad entry.
I've used `reportError` here instead of `report_fatal_error` and updated the test case accordingly.
================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3927-3928
+ StringRef File = StringTable.size() >= Verneed->vn_file
+ ? StringTable.drop_front(Verneed->vn_file)
+ : "<invalid>";
----------------
jhenderson wrote:
> You probably need a test case for `vn_file > StringTable.size()` (but the string table exists) and `vn_file == StringTable.size()`.
It had an issue when `vn_file == StringTable.size()`. I've fixed the condition.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68705/new/
https://reviews.llvm.org/D68705
More information about the llvm-commits
mailing list