[llvm] [GOFF] Set reference to ADA (PR #179734)
Ulrich Weigand via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 5 07:36:41 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:
Well, I was concerned about the specific scenario here, where we have a label in a `ESD_EXE_CODE` section. Is there any valid case where in *this* scenario we either have no begin label or no ADA? The question is whether this would be considered an error and we really should abort, or else whether this is an expected case that can legitimately lead to a label without ADA link ...
I think it might be better to do the ADA NULL check here if needed (and maybe add an assert in `setADA`).
https://github.com/llvm/llvm-project/pull/179734
More information about the llvm-commits
mailing list