[PATCH] D122287: [XCOFF] support writing sections, relocations and symbols for XCOFF64.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 19:25:10 PDT 2022


shchenz added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp:84
+    case MCSymbolRefExpr::VK_PPC_L:
+      return {XCOFF::RelocationType::R_TOCL, 15};
+    }
----------------
Esme wrote:
> shchenz wrote:
> > Should we handle `RelocationType::R_TOCU`? I guess it may be generated in large code model(`-mcmodel=large`).
> `fixup_ppc_half16ds` and `fixup_ppc_half16dq` may only correspond to `lo16` of instrs, not `ha16`, so we shouldn't deal with `RelocationType::R_TOCU` here.
> 
> I have added the corresponding  large code model test in `llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-large.ll`.
Yes, right. When large code model is in effect, the higher 16 bit is relocated by addis which will not use fixup kind `fixup_ppc_half16dq` or `fixup_ppc_half16ds`


================
Comment at: llvm/test/CodeGen/PowerPC/aix-available-externally-linkage.ll:50
+; XCOFF64-NEXT:    SymbolType: XTY_ER (0x0)
+; XCOFF64-NEXT:    StorageMappingClass: XMC_UA (0x4)
+; XCOFF64-NEXT:    Auxiliary Type: AUX_CSECT (0xFB)
----------------
Except this field `Auxiliary Type`, all other fields for the symbol table are the same with XCOFF32, should we reuse them? I prefer to reuse them as we can get a better view about the difference between XCOFF32/XCOFF64.

And many others test files too.


================
Comment at: llvm/test/MC/PowerPC/ppc64-abs-reloc.s:4
+
+# RUN: llvm-mc -triple powerpc-ibm-aix-xcoff %s -filetype=obj -o - | \
+# RUN:    llvm-objdump -D -r - | FileCheck --check-prefix=CHECK-AIX %s
----------------
triple should be 64 bit.


================
Comment at: llvm/test/MC/PowerPC/ppc64-abs-reloc.s:27
+
+# CHECK-AIX: lxv 5, -32752(4)
+# CHECK-AIX: ld 5, -32752(4)
----------------
Exactly the same with above checks, can we reuse?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122287



More information about the llvm-commits mailing list