[llvm] r351948 - [llvm-objcopy] [COFF] Error out on use of unhandled options
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 23 03:54:55 PST 2019
Author: mstorsjo
Date: Wed Jan 23 03:54:55 2019
New Revision: 351948
URL: http://llvm.org/viewvc/llvm-project?rev=351948&view=rev
Log:
[llvm-objcopy] [COFF] Error out on use of unhandled options
Prefer erroring out than silently not doing what was requested.
Differential Revision: https://reviews.llvm.org/D57045
Modified:
llvm/trunk/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
Modified: llvm/trunk/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/COFF/COFFObjcopy.cpp?rev=351948&r1=351947&r2=351948&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/COFF/COFFObjcopy.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/COFF/COFFObjcopy.cpp Wed Jan 23 03:54:55 2019
@@ -170,6 +170,21 @@ static Error handleArgs(const CopyConfig
if (!Config.AddGnuDebugLink.empty())
addGnuDebugLink(Obj, Config.AddGnuDebugLink);
+ if (!Config.BuildIdLinkDir.empty() || Config.BuildIdLinkInput ||
+ Config.BuildIdLinkOutput || !Config.SplitDWO.empty() ||
+ !Config.SymbolsPrefix.empty() || !Config.AddSection.empty() ||
+ !Config.DumpSection.empty() || !Config.KeepSection.empty() ||
+ !Config.SymbolsToGlobalize.empty() || !Config.SymbolsToKeep.empty() ||
+ !Config.SymbolsToLocalize.empty() || !Config.SymbolsToWeaken.empty() ||
+ !Config.SymbolsToKeepGlobal.empty() || !Config.SectionsToRename.empty() ||
+ !Config.SymbolsToRename.empty() || Config.ExtractDWO ||
+ Config.KeepFileSymbols || Config.LocalizeHidden || Config.PreserveDates ||
+ Config.StripDWO || Config.StripNonAlloc || Config.StripSections ||
+ Config.Weaken || Config.DecompressDebugSections) {
+ return createStringError(llvm::errc::invalid_argument,
+ "Option not supported by llvm-objcopy for COFF");
+ }
+
return Error::success();
}
More information about the llvm-commits
mailing list