[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


================
@@ -32,3 +38,47 @@ MCStreamer *llvm::createGOFFStreamer(MCContext &Context,
     S->getAssembler().setRelaxAll(true);
   return S;
 }
+
+void MCGOFFStreamer::initSections(bool NoExecStack,
+                                  const MCSubtargetInfo &STI) {
+  MCContext &Ctx = getContext();
+  switchSection(Ctx.getObjectFileInfo()->getTextSection());
+
+  if (NoExecStack)
+    switchSection(Ctx.getAsmInfo()->getNonexecutableStackSection(Ctx));
+}
----------------
diggerlin wrote:

if NoExecStack is true, the code change the section to TextSection, and change to NonexecutableStackSection immediately without doing other thing ?

can you change the code to
```
  if (NoExecStack) 
     switchSection(Ctx.getAsmInfo()->getNonexecutableStackSection(Ctx) ;
  else
    switchSection(Ctx.getObjectFileInfo()->getTextSection());
```

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


More information about the llvm-commits mailing list