[PATCH] D107398: [llvm-readobj][XCOFF] Warn about invalid offset

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 00:43:36 PDT 2021


vitalybuka added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ObjDumper.cpp:58
+  if (StringContent.size() < StringDataOffset) {
+    reportUniqueWarning("error: offset is out of string contents");
     return;
----------------
jhenderson wrote:
> Please change to "offset X is past the end of the contents (size Y)" with X and Y replaced with the respective values. Errors and warnings should provide useful additional context.
> 
> Also, I don't think the case of no string table should be picked up by this warning: in such a case, the behaviour should be to not dump anything (apart from the `StringTable {}`). From my understanding no string table is a perfectly valid XCOFF construct, and should not result in any warnings or errors.
> 
> What this warning SHOULD pick up is the case where the section is too small for the offset.
@Esme Would you like to follow up on this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107398



More information about the llvm-commits mailing list