Skip to content

Commit

Permalink
[llvm-objcopy] Add support for -g as an alias for --strip-debug
Browse files Browse the repository at this point in the history
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

llvm-svn: 352182
  • Loading branch information
dyung committed Jan 25, 2019
1 parent 56bf7b5 commit 914e838
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/test/tools/llvm-objcopy/ELF/strip-debug.test
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions llvm/tools/llvm-objcopy/ObjcopyOpts.td
Expand Up @@ -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<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">,
Expand Down

0 comments on commit 914e838

Please sign in to comment.