Skip to content

Commit 72f7b0a

Browse files
authored
Update Driver.cpp
1 parent ccf5e33 commit 72f7b0a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lld/COFF/Driver.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -1710,16 +1710,6 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
17101710
config->driver |=
17111711
config->driverUponly || config->driverWdm || args.hasArg(OPT_driver);
17121712

1713-
// Check if any ObjFile instance has kernel enabled
1714-
if (!config->driver) {
1715-
for (ObjFile *file : ctx.objFileInstances) {
1716-
if (file->doesKernelDriver()) {
1717-
config->driver = true;
1718-
break;
1719-
}
1720-
}
1721-
}
1722-
17231713
// Handle /pdb
17241714
bool shouldCreatePDB =
17251715
(debug == DebugKind::Full || debug == DebugKind::GHash ||
@@ -2207,7 +2197,17 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
22072197
if (std::optional<StringRef> path = findLibIfNew("Psapi.lib"))
22082198
enqueuePath(*path, false, false);
22092199
}
2210-
2200+
2201+
// Check if any ObjFile instance has kernel enabled
2202+
if (!config->driver) {
2203+
for (ObjFile *file : ctx.objFileInstances) {
2204+
if (file->doesKernelDriver()) {
2205+
config->driver = true;
2206+
break;
2207+
}
2208+
}
2209+
}
2210+
22112211
// Handle /RELEASE
22122212
if (args.hasArg(OPT_release))
22132213
config->writeCheckSum = true;

0 commit comments

Comments
 (0)