[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 21:57:48 PST 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:266
 
   // Reset the symbol table and string table.
   SymbolTableEntryCount = 0;
----------------
Comment needs updating.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:396
+      "getFragmentOffset should return less than UINT32_MAX in 32-bit mode.");
+  uint32_t FixupOffsetInCSect =
+      Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
----------------
I believe we decided that the PascalCase for "csect" is `Csect`.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:406
+
+  uint32_t Index = (SymA.isTemporary() || SymA.isUndefined(false))
+                       ? SymbolIndexMap[SymASec->getQualNameSymbol()]
----------------
Is this really about temporary symbols, or is this more to do with linkage?


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:411
+  // Only R_POS relocation type requires setting the FixedValue.
+  // The value we put in here is the symbol address relaitve to the 
+  // beginning of the object file.
----------------
s/relaitve/relative/;

However, I think you mean the "symbol's virtual address in this object file".


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:417
+  
+  XCOFFRelocation Reloc{Index, FixupOffsetInCSect, SignAndSize, Type};
+  MCSectionXCOFF *RelocationSec = cast<MCSectionXCOFF>(Fragment->getParent());
----------------
The coding standards say:
> If you use a braced initializer list when initializing a variable, use an equals before the open curly brace: [ ... ]


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

https://reviews.llvm.org/D72027





More information about the llvm-commits mailing list