[llvm] Add functionality to llvm-objcopy to remove prefixes (PR #79415)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 10:30:23 PST 2024


================
@@ -731,7 +731,15 @@ objcopy::parseObjcopyOptions(ArrayRef<const char *> RawArgsArr,
         llvm::crc32(arrayRefFromStringRef(Debug->getBuffer()));
   }
   Config.SplitDWO = InputArgs.getLastArgValue(OBJCOPY_split_dwo);
+
   Config.SymbolsPrefix = InputArgs.getLastArgValue(OBJCOPY_prefix_symbols);
+  Config.SymbolsPrefixRemove =
+      InputArgs.getLastArgValue(OBJCOPY_prefix_symbols_remove);
+  if (!Config.SymbolsPrefix.empty() && !Config.SymbolsPrefixRemove.empty())
+    return createStringError(
+        errc::invalid_argument,
+        "--prefix-symbols and --prefix-symbols-remove are mutualy exclusive");
----------------
appujee wrote:

Yeah it is better to not facilitate both options at the same time. Picking the last flag could be another option but erroring out is also fine.

https://github.com/llvm/llvm-project/pull/79415


More information about the llvm-commits mailing list