From bd5f29c0081ffe03e6a9cf43bca471e7f82fe71d Mon Sep 17 00:00:00 2001 From: Tejas Vipin Date: Fri, 7 Mar 2025 14:04:29 +0530 Subject: [llvm-strip] Let llvm-strip continue on encountering an error (#129531) This change means that llvm-strip no longer exits immediately upon encountering an error when modifying a file and will instead continue modifying the other inputs. Fixes #129412 --- llvm/tools/llvm-objcopy/llvm-objcopy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/tools/llvm-objcopy/llvm-objcopy.cpp') diff --git a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp index 7e708e3..3b11088 100644 --- a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp +++ b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp @@ -247,14 +247,16 @@ int llvm_objcopy_main(int argc, char **argv, const llvm::ToolContext &) { WithColor::error(errs(), ToolName)); return 1; } + + int ret = 0; for (ConfigManager &ConfigMgr : DriverConfig->CopyConfigs) { assert(!ConfigMgr.Common.ErrorCallback); ConfigMgr.Common.ErrorCallback = reportWarning; if (Error E = executeObjcopy(ConfigMgr)) { logAllUnhandledErrors(std::move(E), WithColor::error(errs(), ToolName)); - return 1; + ret = 1; } } - return 0; + return ret; } -- cgit v1.1