Index: llvm/lib/ExecutionEngine/Orc/Core.cpp =================================================================== --- llvm/lib/ExecutionEngine/Orc/Core.cpp +++ llvm/lib/ExecutionEngine/Orc/Core.cpp @@ -374,8 +374,12 @@ #ifndef NDEBUG for (auto &KV : Symbols) { auto I = SymbolFlags.find(KV.first); - assert(I != SymbolFlags.end() && - "Resolving symbol outside this responsibility set"); + // Certain file formats like COFF add symbols to the symbol table + // that don't exist in the IR. Therefore, we just ignore it if + // there are extra symbols. + if (I == SymbolFlags.end()) + continue; + // Mask out Exported for compatibility with COFF constexpr auto Mask = ~JITSymbolFlags::Exported; if (I->second.isWeak()) @@ -866,7 +870,12 @@ auto I = Symbols.find(Name); - assert(I != Symbols.end() && "Symbol not found"); + // Certain file formats like COFF add symbols to the symbol table + // that don't exist in the IR. Therefore, we just ignore it if + // there are extra symbols. + if (I == Symbols.end()) + continue; + assert(!I->second.hasMaterializerAttached() && "Resolving symbol with materializer attached?"); assert(I->second.getState() == SymbolState::Materializing &&