diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index 16b54c42dd61..371056bc58c0 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -2197,17 +2197,7 @@ void LinkerDriver::linkerMain(ArrayRef argsArr) { if (std::optional path = findLibIfNew("Psapi.lib")) enqueuePath(*path, false, false); } - - // Check if any ObjFile instance has kernel enabled - if (!config->driver) { - for (ObjFile *file : ctx.objFileInstances) { - if (file->doesKernelDriver()) { - config->driver = true; - break; - } - } - } - + // Handle /RELEASE if (args.hasArg(OPT_release)) config->writeCheckSum = true;