[llvm] [GOFF] Set reference to ADA (PR #179734)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 5 04:12:15 PST 2026


================
@@ -55,16 +55,20 @@ void MCGOFFStreamer::changeSection(MCSection *Section, uint32_t Subsection) {
   }
 }
 
-void MCGOFFStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
+void MCGOFFStreamer::emitLabel(MCSymbol *Sym, SMLoc Loc) {
   MCSectionGOFF *Section =
       static_cast<MCSectionGOFF *>(getCurrentSectionOnly());
+  MCSymbolGOFF *Symbol = static_cast<MCSymbolGOFF *>(Sym);
   if (Section->isPR()) {
     if (Section->getBeginSymbol() == nullptr)
       Section->setBeginSymbol(Symbol);
     else
       getContext().reportError(
           Loc, "only one symbol can be defined in a PR section.");
   }
+  if (Section->getBeginSymbol() && Symbol->getCodeData() == GOFF::ESD_EXE_CODE)
+    Symbol->setADA(
+        static_cast<MCSymbolGOFF *>(Section->getBeginSymbol())->getADA());
----------------
uweigand wrote:

I'm a bit confused about the various conditions here.  Under what circumstances can the section not have a begin symbol, or have a begin symbol but with a NULL ADA link?  Should the NULL ADA check, if needed, be here or in setADA?

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


More information about the llvm-commits mailing list