llvm-objcopy-12.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From abacd83232acf69d7cbacd53fc2f9aae66c1a32e Mon Sep 17 00:00:00 2001
  2. From: Martin Storsjo <martin@martin.st>
  3. Date: Wed, 23 Jan 2019 11:54:55 +0000
  4. Subject: [PATCH] [llvm-objcopy] [COFF] Error out on use of unhandled options
  5. Prefer erroring out than silently not doing what was requested.
  6. Differential Revision: https://reviews.llvm.org/D57045
  7. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351948 91177308-0d34-0410-b5e6-96231b3b80d8
  8. ---
  9. tools/llvm-objcopy/COFF/COFFObjcopy.cpp | 15 +++++++++++++++
  10. 1 file changed, 15 insertions(+)
  11. diff --git a/llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp b/llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
  12. index 64b4e79a4e0..b7b3d3cb629 100644
  13. --- a/llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
  14. +++ b/llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
  15. @@ -170,6 +170,21 @@ static Error handleArgs(const CopyConfig &Config, Object &Obj) {
  16. if (!Config.AddGnuDebugLink.empty())
  17. addGnuDebugLink(Obj, Config.AddGnuDebugLink);
  18. + if (!Config.BuildIdLinkDir.empty() || Config.BuildIdLinkInput ||
  19. + Config.BuildIdLinkOutput || !Config.SplitDWO.empty() ||
  20. + !Config.SymbolsPrefix.empty() || !Config.AddSection.empty() ||
  21. + !Config.DumpSection.empty() || !Config.KeepSection.empty() ||
  22. + !Config.SymbolsToGlobalize.empty() || !Config.SymbolsToKeep.empty() ||
  23. + !Config.SymbolsToLocalize.empty() || !Config.SymbolsToWeaken.empty() ||
  24. + !Config.SymbolsToKeepGlobal.empty() || !Config.SectionsToRename.empty() ||
  25. + !Config.SymbolsToRename.empty() || Config.ExtractDWO ||
  26. + Config.KeepFileSymbols || Config.LocalizeHidden || Config.PreserveDates ||
  27. + Config.StripDWO || Config.StripNonAlloc || Config.StripSections ||
  28. + Config.Weaken || Config.DecompressDebugSections) {
  29. + return createStringError(llvm::errc::invalid_argument,
  30. + "Option not supported by llvm-objcopy for COFF");
  31. + }
  32. +
  33. return Error::success();
  34. }
  35. --
  36. 2.17.1