From 4bdebd9b2796943a3fe18e78428ffffe2d0278a5 Mon Sep 17 00:00:00 2001 From: Jake Ehrlich Date: Tue, 9 Oct 2018 21:14:09 +0000 Subject: [PATCH] [llvm-objcopy] Make -S an alias for --strip-all -S should be an alias for --strip-all not --strip-all-gnu llvm-svn: 344080 --- test/tools/llvm-objcopy/strip-all-gnu.test | 2 -- test/tools/llvm-objcopy/strip-all.test | 4 ++++ tools/llvm-objcopy/ObjcopyOpts.td | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/tools/llvm-objcopy/strip-all-gnu.test b/test/tools/llvm-objcopy/strip-all-gnu.test index 7e3b5ceb2dc..15e200525b2 100644 --- a/test/tools/llvm-objcopy/strip-all-gnu.test +++ b/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/test/tools/llvm-objcopy/strip-all.test b/test/tools/llvm-objcopy/strip-all.test index bc01835a4cb..8c0f7489134 100644 --- a/test/tools/llvm-objcopy/strip-all.test +++ b/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/tools/llvm-objcopy/ObjcopyOpts.td b/tools/llvm-objcopy/ObjcopyOpts.td index 3a3c82c4573..18b270b7758 100644 --- a/tools/llvm-objcopy/ObjcopyOpts.td +++ b/tools/llvm-objcopy/ObjcopyOpts.td @@ -67,10 +67,10 @@ defm add_section : Eq<"add-section">, HelpText<"Make a section named
with the contents of .">; def strip_all : Flag<["-", "--"], "strip-all">, HelpText<"Remove non-allocated sections other than .gnu.warning* sections">; +def S : Flag<["-"], "S">, + Alias; def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">, HelpText<"Compaitable with GNU objcopy's --strip-all">; -def S : Flag<["-"], "S">, - Alias; def strip_debug : Flag<["-", "--"], "strip-debug">, HelpText<"Remove all debug information">; def strip_dwo : Flag<["-", "--"], "strip-dwo">,