[PATCH] D53163: [llvm-strip] Support -s alias for --strip-all. Make both strip and objcopy case sensitive to support both -s (--strip-all) and -S (--strip-debug).

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 11:48:52 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL345068: [llvm-strip] Support -s alias for --strip-all. Make both strip and objcopy caseā€¦ (authored by rupprecht, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D53163

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


Index: llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp
===================================================================
--- llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp
+++ llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp
@@ -61,7 +61,7 @@
 
 class ObjcopyOptTable : public opt::OptTable {
 public:
-  ObjcopyOptTable() : OptTable(ObjcopyInfoTable, true) {}
+  ObjcopyOptTable() : OptTable(ObjcopyInfoTable) {}
 };
 
 enum StripID {
@@ -90,7 +90,7 @@
 
 class StripOptTable : public opt::OptTable {
 public:
-  StripOptTable() : OptTable(StripInfoTable, true) {}
+  StripOptTable() : OptTable(StripInfoTable) {}
 };
 
 enum SectionFlag {
Index: llvm/trunk/tools/llvm-objcopy/StripOpts.td
===================================================================
--- llvm/trunk/tools/llvm-objcopy/StripOpts.td
+++ llvm/trunk/tools/llvm-objcopy/StripOpts.td
@@ -19,6 +19,9 @@
 def strip_all : Flag<["-", "--"], "strip-all">,
                 HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
 
+def s : Flag<["-"], "s">,
+        Alias<strip_all>;
+
 def strip_debug : Flag<["-", "--"], "strip-debug">,
                   HelpText<"Remove debugging symbols only">;
 
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
@@ -39,12 +39,16 @@
 # RUN: llvm-objcopy -S %t9 %t9
 # RUN: cmp %t2 %t9
 
+# RUN: cp %t %t10
+# RUN: llvm-strip -s %t10
+# RUN: cmp %t2 %t10
+
 # Verify that a non-existent symbol table (after first call to llvm-strip)
 # can be handled correctly.
-# RUN: cp %t %t9
-# RUN: llvm-strip --strip-all -keep=unavailable_symbol %t9
-# RUN: llvm-strip --strip-all -keep=unavailable_symbol %t9
-# RUN: cmp %t2 %t9
+# RUN: cp %t %t11
+# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t11
+# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t11
+# RUN: cmp %t2 %t11
 
 !ELF
 FileHeader:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53163.170717.patch
Type: text/x-patch
Size: 2020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181023/b6e1a3c6/attachment.bin>


More information about the llvm-commits mailing list