summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Ehrlich <jakehehrlich@google.com>2018-10-09 21:14:09 +0000
committerJake Ehrlich <jakehehrlich@google.com>2018-10-09 21:14:09 +0000
commit5e49846ca60ceafad396f30fd545221199ca0af7 (patch)
tree996ed2f111b93c7565a728efd77611568cebe77c
parent8aa69e99272c4ed92b9e82907f539f7bd6079e88 (diff)
downloadbcm5719-llvm-5e49846ca60ceafad396f30fd545221199ca0af7.tar.gz
bcm5719-llvm-5e49846ca60ceafad396f30fd545221199ca0af7.zip
[llvm-objcopy] Make -S an alias for --strip-all
-S should be an alias for --strip-all not --strip-all-gnu llvm-svn: 344080
-rw-r--r--llvm/test/tools/llvm-objcopy/strip-all-gnu.test2
-rw-r--r--llvm/test/tools/llvm-objcopy/strip-all.test4
-rw-r--r--llvm/tools/llvm-objcopy/ObjcopyOpts.td4
3 files changed, 6 insertions, 4 deletions
diff --git a/llvm/test/tools/llvm-objcopy/strip-all-gnu.test b/llvm/test/tools/llvm-objcopy/strip-all-gnu.test
index 7e3b5ceb2dc..15e200525b2 100644
--- a/llvm/test/tools/llvm-objcopy/strip-all-gnu.test
+++ b/llvm/test/tools/llvm-objcopy/strip-all-gnu.test
@@ -2,8 +2,6 @@
# 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:
diff --git a/llvm/test/tools/llvm-objcopy/strip-all.test b/llvm/test/tools/llvm-objcopy/strip-all.test
index bc01835a4cb..8c0f7489134 100644
--- a/llvm/test/tools/llvm-objcopy/strip-all.test
+++ b/llvm/test/tools/llvm-objcopy/strip-all.test
@@ -35,6 +35,10 @@
# RUN: llvm-strip --strip-all %t8
# RUN: cmp %t2 %t8
+# RUN: cp %t %t9
+# RUN: llvm-objcopy -S %t9 %t9
+# RUN: cmp %t2 %t9
+
# Verify that a non-existent symbol table (after first call to llvm-strip)
# can be handled correctly.
# RUN: cp %t %t9
diff --git a/llvm/tools/llvm-objcopy/ObjcopyOpts.td b/llvm/tools/llvm-objcopy/ObjcopyOpts.td
index 3a3c82c4573..18b270b7758 100644
--- a/llvm/tools/llvm-objcopy/ObjcopyOpts.td
+++ b/llvm/tools/llvm-objcopy/ObjcopyOpts.td
@@ -67,10 +67,10 @@ defm add_section : Eq<"add-section">,
HelpText<"Make a section named <section> with the contents of <file>.">;
def strip_all : Flag<["-", "--"], "strip-all">,
HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
+def S : Flag<["-"], "S">,
+ Alias<strip_all>;
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">,
OpenPOWER on IntegriCloud