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

Ting Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 04:45:35 PDT 2022


tingwang added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:2381
 
   SectionKind GVKind = getObjFileLowering().getKindForGlobal(GV, TM);
   if (!GVKind.isGlobalWriteableData() && !GVKind.isReadOnly() &&
----------------
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.)


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