From: Douglas Yung Date: Fri, 25 Jan 2019 09:57:20 +0000 (+0000) Subject: [llvm-objcopy] Add support for -g as an alias for --strip-debug X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cc973513415365656180a1fadb58965e1c989fb;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352182 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/llvm-objcopy/ELF/strip-debug.test b/test/tools/llvm-objcopy/ELF/strip-debug.test index b88744e5f42..d7079f6abcb 100644 --- a/test/tools/llvm-objcopy/ELF/strip-debug.test +++ b/test/tools/llvm-objcopy/ELF/strip-debug.test @@ -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 diff --git a/tools/llvm-objcopy/ObjcopyOpts.td b/tools/llvm-objcopy/ObjcopyOpts.td index 1f7e64e4091..57d8bf177b8 100644 --- a/tools/llvm-objcopy/ObjcopyOpts.td +++ b/tools/llvm-objcopy/ObjcopyOpts.td @@ -95,6 +95,8 @@ def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">, HelpText<"Compatible with GNU objcopy's --strip-all">; def strip_debug : Flag<["-", "--"], "strip-debug">, HelpText<"Remove all debug information">; +def g : Flag<["-"], "g">, Alias, + 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">,