diff --git a/lld/COFF/Symbols.h b/lld/COFF/Symbols.h index 5ef46f5af6a6c8d..56b137d56873aa2 100644 --- a/lld/COFF/Symbols.h +++ b/lld/COFF/Symbols.h @@ -98,10 +98,10 @@ class Symbol { friend SymbolTable; explicit Symbol(Kind k, StringRef n = "") : symbolKind(k), isExternal(true), isCOMDAT(false), - writtenToSymtab(false), pendingArchiveLoad(false), isGCRoot(false), - isRuntimePseudoReloc(false), deferUndefined(false), canInline(true), - isWeak(false), nameSize(n.size()), - nameData(n.empty() ? nullptr : n.data()) { + writtenToSymtab(false), isUsedInRegularObj(false), + pendingArchiveLoad(false), isGCRoot(false), isRuntimePseudoReloc(false), + deferUndefined(false), canInline(true), isWeak(false), + nameSize(n.size()), nameData(n.empty() ? nullptr : n.data()) { assert((!n.empty() || k <= LastDefinedCOFFKind) && "If the name is empty, the Symbol must be a DefinedCOFF."); } @@ -499,8 +499,10 @@ void replaceSymbol(Symbol *s, ArgT &&... arg) { assert(static_cast(static_cast(nullptr)) == nullptr && "Not a Symbol"); bool canInline = s->canInline; + bool isUsedInRegularObj = s->isUsedInRegularObj; new (s) T(std::forward(arg)...); s->canInline = canInline; + s->isUsedInRegularObj = isUsedInRegularObj; } } // namespace coff