[llvm-branch-commits] [llvm] [GOFF] Add writing of section symbols (PR #133799)

Kai Nacke via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Apr 7 12:18:38 PDT 2025


================
@@ -26,6 +27,29 @@ GOFFObjectWriter &MCGOFFStreamer::getWriter() {
   return static_cast<GOFFObjectWriter &>(getAssembler().getWriter());
 }
 
+void MCGOFFStreamer::initSections(bool /*NoExecStack*/,
+                                  const MCSubtargetInfo &STI) {
+  MCContext &Ctx = getContext();
+  // Emit the text section.
+  switchSection(Ctx.getObjectFileInfo()->getTextSection());
+}
+
+namespace {
+// Make sure that all section are registered in the correct order.
+void registerSectionHierarchy(MCAssembler &Asm, MCSectionGOFF *Section) {
+  if (Section->isRegistered())
+    return;
+  if (Section->getParent())
+    registerSectionHierarchy(Asm, Section->getParent());
+  registerSectionHierarchy(Asm, Section);
----------------
redstar wrote:

Yes, that's a bug. It should call `Asm.registerSection()` instead.

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


More information about the llvm-branch-commits mailing list