[llvm] [SystemZ][z/OS] Implement executePostLayoutBinding for GOFFObjectWriter (PR #67868)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 11:14:47 PDT 2023


================
@@ -2683,6 +2683,10 @@ MCSection *TargetLoweringObjectFileGOFF::getExplicitSectionGlobal(
 MCSection *TargetLoweringObjectFileGOFF::SelectSectionForGlobal(
     const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const {
   auto *Symbol = TM.getSymbol(GO);
+  if (Kind.isData())
+    return getContext().getGOFFSection(Symbol->getName(),
+                                       SectionKind::getData());
+
   if (Kind.isBSS())
     return getContext().getGOFFSection(Symbol->getName(), SectionKind::getBSS(),
                                        nullptr, nullptr);
----------------
diggerlin wrote:

you can delete the  `nullptr, nullptr`. since you change the function definition as 


```
MMCSectionGOFF *getGOFFSection(StringRef Section, SectionKind Kind,
                                MCSection *Parent = nullptr,
                                const MCExpr *SubsectionId = nullptr);CSection *Parent = nullptr,
const MCExpr *SubsectionId = nullptr)
```

https://github.com/llvm/llvm-project/pull/67868


More information about the llvm-commits mailing list