[llvm] r333940 - [llvm-strip] Add missing aliases for --strip-debug

Alexander Shaposhnikov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 11:55:41 PDT 2018


Author: alexshap
Date: Mon Jun  4 11:55:41 2018
New Revision: 333940

URL: http://llvm.org/viewvc/llvm-project?rev=333940&view=rev
Log:
[llvm-strip] Add missing aliases for --strip-debug

Add missing aliases for --strip-debug: -g, -S, -d.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D47674

Modified:
    llvm/trunk/test/tools/llvm-objcopy/strip-debug.test
    llvm/trunk/tools/llvm-objcopy/StripOpts.td

Modified: llvm/trunk/test/tools/llvm-objcopy/strip-debug.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/strip-debug.test?rev=333940&r1=333939&r2=333940&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/strip-debug.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/strip-debug.test Mon Jun  4 11:55:41 2018
@@ -1,15 +1,26 @@
 # RUN: yaml2obj %s > %t
+# RUN: cp %t %t3
 # RUN: llvm-objcopy -strip-debug %t %t2
 # RUN: llvm-readobj -file-headers -sections -symbols %t2 | FileCheck %s
 
-# We run yaml2obj again rather than copy %t to avoid interfering 
-# with llvm-objcopy's test (which potentially could have corrupted/updated the binary).
+# Verify that the previous run of llvm-objcopy has not modified the input.
+# RUN: cmp %t %t3
 
-# RUN: yaml2obj %s > %t3
 # RUN: llvm-strip -strip-debug %t3
-# RUN: llvm-readobj -file-headers -sections -symbols %t3 | FileCheck %s
 # RUN: cmp %t2 %t3
 
+# RUN: cp %t %t4
+# RUN: llvm-strip -d %t4
+# RUN: cmp %t2 %t4
+
+# RUN: cp %t %t5
+# RUN: llvm-strip -g %t5
+# RUN: cmp %t2 %t5
+
+# RUN: cp %t %t6
+# RUN: llvm-strip -S %t6
+# RUN: cmp %t2 %t6
+
 !ELF
 FileHeader:
   Class:           ELFCLASS64

Modified: llvm/trunk/tools/llvm-objcopy/StripOpts.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/StripOpts.td?rev=333940&r1=333939&r2=333940&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/StripOpts.td (original)
+++ llvm/trunk/tools/llvm-objcopy/StripOpts.td Mon Jun  4 11:55:41 2018
@@ -14,6 +14,15 @@ defm output : Eq<"o">,
 def strip_debug : Flag<["-", "--"], "strip-debug">,
                   HelpText<"Remove debugging symbols only">;
 
+def d : Flag<["-"], "d">,
+        Alias<strip_debug>;
+
+def g : Flag<["-"], "g">,
+        Alias<strip_debug>;
+
+def S : Flag<["-"], "S">,
+        Alias<strip_debug>;
+
 defm remove_section : Eq<"remove-section">,
                       MetaVarName<"section">,
                       HelpText<"Remove <section>">;




More information about the llvm-commits mailing list