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

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 08:49:41 PST 2020


jasonliu marked 3 inline comments as done.
jasonliu added inline comments.


================
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;
----------------
hubert.reinterpretcast wrote:
> hubert.reinterpretcast wrote:
> > 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`.
> I believe that `sizeof(llvm::object::XCOFFRelocation32)` is 10 (and we should not hard-code `10` here).
Could we include headers from llvm/Object in MC components?
It seems the current convention is to only use headers from llvm/BinaryFormat, and llvm/Object is more for tooling purpose(llvm-readobj, llvm-objdump) and not object generation. 


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

https://reviews.llvm.org/D72027





More information about the llvm-commits mailing list