[llvm-strip] Expose --strip-unneeded option

Differential Revision: https://reviews.llvm.org/D47818

llvm-svn: 334182
diff --git a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
index 4676983..bf58f34 100644
--- a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
+++ b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
@@ -583,12 +583,12 @@
   Config.OutputFilename =
       InputArgs.getLastArgValue(STRIP_output, Positional[0]);
 
-  // Strip debug info only.
   Config.StripDebug = InputArgs.hasArg(STRIP_strip_debug);
   
   Config.DiscardAll = InputArgs.hasArg(STRIP_discard_all);
-  
-  if (!Config.StripDebug && !Config.DiscardAll)
+  Config.StripUnneeded = InputArgs.hasArg(STRIP_strip_unneeded);
+
+  if (!Config.StripDebug && !Config.StripUnneeded && !Config.DiscardAll)
     Config.StripAll = true;
 
   for (auto Arg : InputArgs.filtered(STRIP_remove_section))