[PATCH] D63843: [Object][XCOFF] Add support for 64-bit file header and section header dumping.

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 21:22:15 PDT 2019


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:477
+  if (auto EC = Binary::checkOffset(
+          Obj->Data, reinterpret_cast<uintptr_t>(Obj->base()) + Offset, 4))
+    return XCOFFStringTable{0, nullptr};
----------------
I would much prefer to perform the addition before the cast.


================
Comment at: llvm/tools/llvm-readobj/XCOFFDumper.cpp:155
+
+    // TODO Need to add overflow handling (when NumberOfX == STYP_OVRFLO).
+    W.printNumber("NumberOfRelocations", Sec.NumberOfRelocations);
----------------
s/STYP_OVRFLO/_OVERFLOW_MARKER/;

There's no `_OVERFLOW_MARKER` in the code currently, so we might want to add an appropriate named constant.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63843





More information about the llvm-commits mailing list