Index: llvm/trunk/test/tools/llvm-objcopy/strip-all.test =================================================================== --- llvm/trunk/test/tools/llvm-objcopy/strip-all.test +++ llvm/trunk/test/tools/llvm-objcopy/strip-all.test @@ -27,6 +27,14 @@ # RUN: llvm-ar p %t.a > %t6 # RUN: cmp %t2 %t6 +# RUN: cp %t %t7 +# RUN: llvm-strip -strip-all %t7 +# RUN: cmp %t2 %t7 + +# RUN: cp %t %t8 +# RUN: llvm-strip --strip-all %t8 +# RUN: cmp %t2 %t8 + !ELF FileHeader: Class: ELFCLASS64 Index: llvm/trunk/tools/llvm-objcopy/StripOpts.td =================================================================== --- llvm/trunk/tools/llvm-objcopy/StripOpts.td +++ llvm/trunk/tools/llvm-objcopy/StripOpts.td @@ -11,6 +11,9 @@ MetaVarName<"output">, HelpText<"Write output to ">; +def strip_all : Flag<["-", "--"], "strip-all">, + HelpText<"Remove non-allocated sections other than .gnu.warning* sections">; + def strip_debug : Flag<["-", "--"], "strip-debug">, HelpText<"Remove debugging symbols only">; Index: llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp =================================================================== --- llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp +++ llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp @@ -655,6 +655,7 @@ Config.DiscardAll = InputArgs.hasArg(STRIP_discard_all); Config.StripUnneeded = InputArgs.hasArg(STRIP_strip_unneeded); + Config.StripAll = InputArgs.hasArg(STRIP_strip_all); if (!Config.StripDebug && !Config.StripUnneeded && !Config.DiscardAll) Config.StripAll = true;