1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[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

llvm-svn: 351948
This commit is contained in:
Martin Storsjo 2019-01-23 11:54:55 +00:00
parent 9d872b4a9a
commit da693adf63

View File

@ -170,6 +170,21 @@ static Error handleArgs(const CopyConfig &Config, Object &Obj) {
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();
}