Skip to content

Commit 14f31d4

Browse files
committed
Let llvm-objcopy continue on encountering an error
Lets tools that use llvm-objcopy continue with working on files on encountering an error by logging it instead of returning it early. This lets tools like llvm-strip function as expected while processing multiple files.
1 parent 05589ee commit 14f31d4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/tools/llvm-objcopy/llvm-objcopy.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,17 @@ int llvm_objcopy_main(int argc, char **argv, const llvm::ToolContext &) {
247247
WithColor::error(errs(), ToolName));
248248
return 1;
249249
}
250+
251+
int ret = 0;
252+
250253
for (ConfigManager &ConfigMgr : DriverConfig->CopyConfigs) {
251254
assert(!ConfigMgr.Common.ErrorCallback);
252255
ConfigMgr.Common.ErrorCallback = reportWarning;
253256
if (Error E = executeObjcopy(ConfigMgr)) {
254257
logAllUnhandledErrors(std::move(E), WithColor::error(errs(), ToolName));
255-
return 1;
258+
ret = 1;
256259
}
257260
}
258261

259-
return 0;
262+
return ret;
260263
}

0 commit comments

Comments
 (0)