[PATCH] D59419: [XCOFF] Add functionality for parsing AIX XCOFF object files header .

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 21:28:40 PDT 2019


hubert.reinterpretcast added inline comments.
Herald added a subscriber: jsji.


================
Comment at: llvm/include/llvm/Object/XCOFFObjectFile.h:44
+  
+  support::big32_t SymbolTableOffset; // File offset to symbol table.
+  support::big32_t NumberOfSymTableEntries;
----------------
When `_XCOFF_UOFFSET` is set, the AIX headers treat this field as unsigned. Indications are that values greater than those of the corresponding signed type are indeed valid (despite difficulties in using files with such values with the AIX system linker).


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:241
+  // Check the whether the binary file contains an XCOFF Header.
+  if (!checkSize(Data, EC, sizeof(XCOFFFileHeader)))
+    return;
----------------
`getObject` below does size checking too. What does having this check here add?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59419





More information about the llvm-commits mailing list