[llvm-branch-commits] [llvm] [SystemZ] Implement ctor/dtor emission via @@SQINIT and .xtor sections (PR #171476)

Kai Nacke via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 10 06:54:23 PST 2025


================
@@ -1012,6 +1021,59 @@ void SystemZAsmPrinter::emitMachineConstantPoolValue(
   OutStreamer->emitValue(Expr, Size);
 }
 
+// Emit the ctor or dtor list taking into account the init priority.
+void SystemZAsmPrinter::emitXXStructorList(const DataLayout &DL,
+                                           const Constant *List, bool IsCtor) {
+  if (TM.getTargetTriple().isOSBinFormatGOFF())
+    AsmPrinter::emitXXStructorList(DL, List, IsCtor);
----------------
redstar wrote:

That should be:

```
  if (!TM.getTargetTriple().isOSBinFormatGOFF())
    return AsmPrinter::emitXXStructorList(DL, List, IsCtor);
```

The default code handles Linux/ELF, the following lines are Z/OS / GOFF only.

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


More information about the llvm-branch-commits mailing list