[lld] [llvm] [MC, COFF] Change how we handle section symbols (PR #96459)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 24 16:55:45 PDT 2024
================
@@ -842,12 +847,21 @@ void WinCOFFWriter::executePostLayoutBinding(MCAssembler &Asm,
defineSection(static_cast<const MCSectionCOFF &>(Section), Layout);
}
- if (Mode != DwoOnly)
- for (const MCSymbol &Symbol : Asm.symbols())
- // Define non-temporary or temporary static (private-linkage) symbols
- if (!Symbol.isTemporary() ||
- cast<MCSymbolCOFF>(Symbol).getClass() == COFF::IMAGE_SYM_CLASS_STATIC)
- DefineSymbol(Symbol, Asm, Layout);
+ auto isSectionSymbol = [](const MCSymbol &Sym) {
+ return Sym.isInSection() && Sym.getSection().getBeginSymbol() == &Sym;
+ };
+
+ for (const MCSymbol &Sym : Asm.symbols())
+ if (isSectionSymbol(Sym))
+ DefineSymbol(Sym, Asm, Layout);
+ if (Mode == DwoOnly)
+ return;
+ for (const MCSymbol &Sym : Asm.symbols())
----------------
MaskRay wrote:
The update reverts this change.
https://github.com/llvm/llvm-project/pull/96459
More information about the llvm-commits
mailing list