[PATCH] D122198: [PowerPC] Add .ref in backend for AIX XCOFF to support `-bcdtors:csect` linker option

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 19:00:58 PDT 2022


shchenz added inline comments.


================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:937
+  assert(
+      !(Name.endswith_insensitive("[bs]") ||
+        Name.endswith_insensitive("[uc]")) &&
----------------
can we use `getCurrentSectionOnly()`?


================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:2381
 
   SectionKind GVKind = getObjFileLowering().getKindForGlobal(GV, TM);
   if (!GVKind.isGlobalWriteableData() && !GVKind.isReadOnly() &&
----------------
tingwang wrote:
> shchenz wrote:
> > can we change the `GVkind` here for static globals with associated metadata? We use BSS kind for normal static globals, maybe we can change it to RW, so that we may don't need to change `MCSectionXCOFF::printSwitchToSection` and `TargetLoweringObjectFileXCOFF::SelectSectionForGlobal`?
> My initial thought was the same. After looking into TargetLoweringObjectFile::getKindForGlobal(), I didn't find any point for platform specific logic to change the decision, and thus I turned into our platform dependent code to make changes here. (If there is already one hook, I will be happy to use that. However at this moment, I don't see any for this purpose.)
Is it possible to custom the GVKind in current function? This function is AIX specific?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122198



More information about the llvm-commits mailing list