[PATCH] D72027: [XCOFF][AIX] Support basic relocation type on AIX

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 14:25:55 PST 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:49
 
+// 32 bit XCOFF Relocation structure itself is 12 byte,
+// however we only use 10 byte spaces when writing it out.
----------------
Suggestion:
The in-memory 32-bit XCOFF relocation structure is 12 bytes long, but the trailing 2-byte padding is omitted in the binary format.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:51
+// however we only use 10 byte spaces when writing it out.
+constexpr unsigned SizeOfXCOFFRelocation32 = 10;
 constexpr unsigned DefaultSectionAlign = 4;
----------------
jasonliu wrote:
> DiggerLin wrote:
> > can we use sizeof(XCOFFRelocation) when using SizeOfXCOFFRelocation32 ?
> No, as I'm trying to express in the comments above, the sizeof(XCOFFRelocation) is 12, but actual size is 10. 
I think we can drop "XCOFF"; this is a .cpp file that is XCOFF-specific.

Suggestion: `RelocationSerializationSize32`.


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

https://reviews.llvm.org/D72027





More information about the llvm-commits mailing list