Skip to content

Commit

Permalink
[llvm-objcopy] Add missing alias for --strip-all-gnu
Browse files Browse the repository at this point in the history
This diff adds -S as an alias for --strip-all-gnu 
(for compatibility with binutils' objcopy).

Patch by Dmitry Golovin!

Test plan: make check-all

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

llvm-svn: 342364
  • Loading branch information
alexander-shaposhnikov committed Sep 17, 2018
1 parent 370eff8 commit 1de445c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/test/tools/llvm-objcopy/strip-all-gnu.test
@@ -1,6 +1,9 @@
# RUN: yaml2obj %s > %t
# RUN: cp %t %t1
# RUN: llvm-objcopy --strip-all-gnu %t %t2
# RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s
# RUN: llvm-objcopy -S %t1 %t3
# RUN: cmp %t2 %t3

!ELF
FileHeader:
Expand Down
2 changes: 2 additions & 0 deletions llvm/tools/llvm-objcopy/ObjcopyOpts.td
Expand Up @@ -67,6 +67,8 @@ def strip_all : Flag<["-", "--"], "strip-all">,
HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
HelpText<"Compaitable with GNU objcopy's --strip-all">;
def S : Flag<["-"], "S">,
Alias<strip_all_gnu>;
def strip_debug : Flag<["-", "--"], "strip-debug">,
HelpText<"Remove all debug information">;
def strip_dwo : Flag<["-", "--"], "strip-dwo">,
Expand Down

0 comments on commit 1de445c

Please sign in to comment.