[llvm] [SystemZ] Fix zero length PR section for zero size BSS globals (PR #225863)

Kai Nacke via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 06:46:16 PDT 2026


================
@@ -369,7 +369,7 @@ void GOFFWriter::defineSectionSymbols(const MCSectionGOFF &Section) {
                   Parent->getOrdinal(), Parent->getEDAttributes(),
                   Parent->getEDAlignment(), Section.getPRAttributes());
     PR.SectionLength = Asm.getSectionAddressSize(Section);
-    if (Section.requiresNonZeroLength()) {
+    if (Section.requiresNonZeroLength() || Section.isBSS()) {
----------------
redstar wrote:

The BSS symbol is emitted in `MCGOFFStreamer::emitCommonSymbol()`. Instead of having this special here in the GOFF writer I would prefer to set the `requiresNonZeroLength` flag in the streamer function.

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


More information about the llvm-commits mailing list