[llvm] r352182 - [llvm-objcopy] Add support for -g as an alias for --strip-debug
Douglas Yung via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 25 01:57:21 PST 2019
Author: dyung
Date: Fri Jan 25 01:57:20 2019
New Revision: 352182
URL: http://llvm.org/viewvc/llvm-project?rev=352182&view=rev
Log:
[llvm-objcopy] Add support for -g as an alias for --strip-debug
This change adds an option -g to llvm-objcopy which is an alias for the existing option --strip-debug.
This fixes PR40003.
Reviewed by: alexshap
Differential Revision: https://reviews.llvm.org/D57217
Modified:
llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test
llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td
Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test?rev=352182&r1=352181&r2=352182&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test Fri Jan 25 01:57:20 2019
@@ -6,6 +6,10 @@
# Verify that the previous run of llvm-objcopy has not modified the input.
# RUN: cmp %t %t3
+# RUN: llvm-objcopy -g %t %t2g
+# Verify that --strip-debug and -g produce the same output
+# RUN: cmp %t2 %t2g
+
# RUN: llvm-strip --strip-debug %t3
# RUN: cmp %t2 %t3
Modified: llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td?rev=352182&r1=352181&r2=352182&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td (original)
+++ llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td Fri Jan 25 01:57:20 2019
@@ -95,6 +95,8 @@ def strip_all_gnu : Flag<["-", "--"], "s
HelpText<"Compatible with GNU objcopy's --strip-all">;
def strip_debug : Flag<["-", "--"], "strip-debug">,
HelpText<"Remove all debug information">;
+def g : Flag<["-"], "g">, Alias<strip_debug>,
+ HelpText<"Alias for --strip-debug">;
def strip_dwo : Flag<["-", "--"], "strip-dwo">,
HelpText<"Remove all DWARF .dwo sections from file">;
def strip_sections : Flag<["-", "--"], "strip-sections">,
More information about the llvm-commits
mailing list