[PATCH] D49226: Add --strip-all option back to llvm-strip.

Stephen Hines via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 10:47:14 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL336921: Add --strip-all option back to llvm-strip. (authored by srhines, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D49226

Files:
  llvm/trunk/test/tools/llvm-objcopy/strip-all.test
  llvm/trunk/tools/llvm-objcopy/StripOpts.td
  llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp


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/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;
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 <file>">;
 
+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">;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49226.155220.patch
Type: text/x-patch
Size: 1618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180712/c5a34412/attachment.bin>


More information about the llvm-commits mailing list