[PATCH] D144356: [XCOFF] support the ref directive for object generation.

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 19:33:41 PDT 2023


shchenz added inline comments.


================
Comment at: llvm/lib/MC/MCXCOFFStreamer.cpp:89
+  const MCSymbolRefExpr *SRE = MCSymbolRefExpr::create(Symbol, getContext());
+  MCFixup Fixup = MCFixup::create(DF->getContents().size(), SRE, FK_NONE);
+  DF->getFixups().push_back(Fixup);
----------------
Esme wrote:
> shchenz wrote:
> > Do you think reusing PPC fixup kind `fixup_ppc_nofixup` for AIX `R_REF` type relocation makes more sense?
> The `fixup_ppc_nofixup` is defined in `llvm/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h`, and it looks inappropriate to include that in `llvm/lib/MC`?
yes, I think you would need an interface in `class MCAsmBackend` and override this interface in `class XCOFFPPCAsmBackend`. `FK_NONE` is not a good choice, it is for relocation types that are defined in targets and bigger `FirstLiteralRelocationKind`(Although now PPC does not have any fixup kind bigger than FirstLiteralRelocationKind, but we really should not break this common design.). See `PPCAsmBackend::getFixupKindInfo()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144356



More information about the llvm-commits mailing list