aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/help-message.test4
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test1
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/strip-all.test18
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/strip-version.test1
-rw-r--r--llvm/tools/llvm-objcopy/ObjcopyOpts.td55
-rw-r--r--llvm/tools/llvm-objcopy/StripOpts.td37
6 files changed, 56 insertions, 60 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/help-message.test b/llvm/test/tools/llvm-objcopy/ELF/help-message.test
index 2dc92f6..b0e9cf6 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/help-message.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/help-message.test
@@ -1,11 +1,11 @@
-# RUN: llvm-objcopy -help | FileCheck --check-prefix=OBJCOPY-USAGE %s
+# RUN: llvm-objcopy -h | FileCheck --check-prefix=OBJCOPY-USAGE %s
# RUN: llvm-objcopy --help | FileCheck --check-prefix=OBJCOPY-USAGE %s
# RUN: not llvm-objcopy 2>&1 | FileCheck --check-prefix=OBJCOPY-USAGE %s
# RUN: not llvm-objcopy -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
# RUN: not llvm-objcopy --abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
# RUN: not llvm-objcopy --strip-debug 2>&1 | FileCheck %s --check-prefix=NO-INPUT-FILES
-# RUN: llvm-strip -help | FileCheck --check-prefix=STRIP-USAGE %s
+# RUN: llvm-strip -h | FileCheck --check-prefix=STRIP-USAGE %s
# RUN: llvm-strip --help | FileCheck --check-prefix=STRIP-USAGE %s
# RUN: not llvm-strip 2>&1 | FileCheck --check-prefix=STRIP-USAGE %s
# RUN: not llvm-strip -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s
diff --git a/llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test b/llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test
index f2f7fa0..7494ccd 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/objcopy-version.test
@@ -1,4 +1,3 @@
-# RUN: llvm-objcopy -version | FileCheck %s
# RUN: llvm-objcopy --version | FileCheck %s
# RUN: llvm-objcopy -V | FileCheck %s
diff --git a/llvm/test/tools/llvm-objcopy/ELF/strip-all.test b/llvm/test/tools/llvm-objcopy/ELF/strip-all.test
index 32a801d..dabb9ef 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/strip-all.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/strip-all.test
@@ -28,27 +28,23 @@
# RUN: cmp %t2 %t6
# RUN: cp %t %t7
-# RUN: llvm-strip -strip-all %t7
+# RUN: llvm-strip --strip-all %t7
# RUN: cmp %t2 %t7
# RUN: cp %t %t8
-# RUN: llvm-strip --strip-all %t8
+# RUN: llvm-objcopy -S %t8 %t8
# RUN: cmp %t2 %t8
# RUN: cp %t %t9
-# RUN: llvm-objcopy -S %t9 %t9
+# RUN: llvm-strip -s %t9
# RUN: cmp %t2 %t9
-# RUN: cp %t %t10
-# RUN: llvm-strip -s %t10
-# RUN: cmp %t2 %t10
-
# Verify that a non-existent symbol table (after first call to llvm-strip)
# can be handled correctly.
-# RUN: cp %t %t11
-# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t11
-# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t11
-# RUN: cmp %t2 %t11
+# RUN: cp %t %t10
+# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t10
+# RUN: llvm-strip --strip-all --keep-symbol=unavailable_symbol %t10
+# RUN: cmp %t2 %t10
!ELF
FileHeader:
diff --git a/llvm/test/tools/llvm-objcopy/ELF/strip-version.test b/llvm/test/tools/llvm-objcopy/ELF/strip-version.test
index d1d3165..4b2f137 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/strip-version.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/strip-version.test
@@ -1,4 +1,3 @@
-# RUN: llvm-strip -version | FileCheck %s
# RUN: llvm-strip --version | FileCheck %s
# RUN: llvm-strip -V | FileCheck %s
diff --git a/llvm/tools/llvm-objcopy/ObjcopyOpts.td b/llvm/tools/llvm-objcopy/ObjcopyOpts.td
index bf3a1dc..326a459 100644
--- a/llvm/tools/llvm-objcopy/ObjcopyOpts.td
+++ b/llvm/tools/llvm-objcopy/ObjcopyOpts.td
@@ -1,16 +1,17 @@
include "llvm/Option/OptParser.td"
multiclass Eq<string name, string help> {
- def NAME : Separate<["--", "-"], name>;
- def NAME #_eq : Joined<["--", "-"], name #"=">,
+ def NAME : Separate<["--"], name>;
+ def NAME #_eq : Joined<["--"], name #"=">,
Alias<!cast<Separate>(NAME)>,
HelpText<help>;
}
-def help : Flag<["-", "--"], "help">;
+def help : Flag<["--"], "help">;
+def h : Flag<["-"], "h">, Alias<help>;
def allow_broken_links
- : Flag<["-", "--"], "allow-broken-links">,
+ : Flag<["--"], "allow-broken-links">,
HelpText<"Allow llvm-objcopy to remove sections even if it would leave "
"invalid section references. The appropriate sh_link fields"
"will be set to zero.">;
@@ -32,13 +33,13 @@ defm output_target : Eq<"output-target", "Format of the output file">,
Values<"binary">;
def O : JoinedOrSeparate<["-"], "O">, Alias<output_target>;
-def compress_debug_sections : Flag<["--", "-"], "compress-debug-sections">;
+def compress_debug_sections : Flag<["--"], "compress-debug-sections">;
def compress_debug_sections_eq
- : Joined<["--", "-"], "compress-debug-sections=">,
+ : Joined<["--"], "compress-debug-sections=">,
MetaVarName<"[ zlib | zlib-gnu ]">,
HelpText<"Compress DWARF debug sections using specified style. Supported "
"styles: 'zlib-gnu' and 'zlib'">;
-def decompress_debug_sections : Flag<["-", "--"], "decompress-debug-sections">,
+def decompress_debug_sections : Flag<["--"], "decompress-debug-sections">,
HelpText<"Decompress DWARF debug sections.">;
defm split_dwo
: Eq<"split-dwo", "Equivalent to extract-dwo on the input file to "
@@ -46,7 +47,7 @@ defm split_dwo
MetaVarName<"dwo-file">;
def enable_deterministic_archives
- : Flag<["-", "--"], "enable-deterministic-archives">,
+ : Flag<["--"], "enable-deterministic-archives">,
HelpText<"Enable deterministic mode when copying archives (use zero for "
"UIDs, GIDs, and timestamps).">;
def D : Flag<["-"], "D">,
@@ -54,14 +55,14 @@ def D : Flag<["-"], "D">,
HelpText<"Alias for --enable-deterministic-archives">;
def disable_deterministic_archives
- : Flag<["-", "--"], "disable-deterministic-archives">,
+ : Flag<["--"], "disable-deterministic-archives">,
HelpText<"Disable deterministic mode when copying archives (use real "
"values for UIDs, GIDs, and timestamps).">;
def U : Flag<["-"], "U">,
Alias<disable_deterministic_archives>,
HelpText<"Alias for --disable-deterministic-archives">;
-def preserve_dates : Flag<["-", "--"], "preserve-dates">,
+def preserve_dates : Flag<["--"], "preserve-dates">,
HelpText<"Preserve access and modification timestamps">;
def p : Flag<["-"], "p">, Alias<preserve_dates>;
@@ -109,25 +110,25 @@ defm set_section_flags
"rom, share, contents, merge, strings.">,
MetaVarName<"section=flag1[,flag2,...]">;
-def strip_all : Flag<["-", "--"], "strip-all">,
+def strip_all : Flag<["--"], "strip-all">,
HelpText<"Remove non-allocated sections outside segments. "
".gnu.warning* sections are not removed">;
def S : Flag<["-"], "S">, Alias<strip_all>;
-def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
+def strip_all_gnu : Flag<["--"], "strip-all-gnu">,
HelpText<"Compatible with GNU objcopy's --strip-all">;
-def strip_debug : Flag<["-", "--"], "strip-debug">,
+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">,
+def strip_dwo : Flag<["--"], "strip-dwo">,
HelpText<"Remove all DWARF .dwo sections from file">;
def strip_sections
- : Flag<["-", "--"], "strip-sections">,
+ : Flag<["--"], "strip-sections">,
HelpText<"Remove all section headers and all sections not in segments">;
def strip_non_alloc
- : Flag<["-", "--"], "strip-non-alloc">,
+ : Flag<["--"], "strip-non-alloc">,
HelpText<"Remove all non-allocated sections outside segments">;
-def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
+def strip_unneeded : Flag<["--"], "strip-unneeded">,
HelpText<"Remove all symbols not needed by relocations">;
defm strip_unneeded_symbol
: Eq<"strip-unneeded-symbol",
@@ -140,12 +141,12 @@ defm strip_unneeded_symbols
MetaVarName<"filename">;
def extract_dwo
- : Flag<["-", "--"], "extract-dwo">,
+ : Flag<["--"], "extract-dwo">,
HelpText<
"Remove all sections that are not DWARF .dwo sections from file">;
def localize_hidden
- : Flag<["-", "--"], "localize-hidden">,
+ : Flag<["--"], "localize-hidden">,
HelpText<
"Mark all symbols that have hidden or internal visibility as local">;
defm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
@@ -189,16 +190,16 @@ defm weaken_symbols
MetaVarName<"filename">;
def W : JoinedOrSeparate<["-"], "W">, Alias<weaken_symbol>;
-def weaken : Flag<["-", "--"], "weaken">,
+def weaken : Flag<["--"], "weaken">,
HelpText<"Mark all global symbols as weak">;
-def discard_locals : Flag<["-", "--"], "discard-locals">,
+def discard_locals : Flag<["--"], "discard-locals">,
HelpText<"Remove compiler-generated local symbols, (e.g. "
"symbols starting with .L)">;
def X : Flag<["-"], "X">, Alias<discard_locals>;
def discard_all
- : Flag<["-", "--"], "discard-all">,
+ : Flag<["--"], "discard-all">,
HelpText<"Remove all local symbols except file and section symbols">;
def x : Flag<["-"], "x">, Alias<discard_all>;
defm strip_symbol : Eq<"strip-symbol", "Remove symbol <symbol>">,
@@ -223,11 +224,11 @@ defm keep_symbols
MetaVarName<"filename">;
def only_keep_debug
- : Flag<["-", "--"], "only-keep-debug">,
+ : Flag<["--"], "only-keep-debug">,
HelpText<"Clear sections that would not be stripped by --strip-debug. "
"Currently only implemented for COFF.">;
-def keep_file_symbols : Flag<["-", "--"], "keep-file-symbols">,
+def keep_file_symbols : Flag<["--"], "keep-file-symbols">,
HelpText<"Do not remove file symbols">;
defm dump_section
: Eq<"dump-section",
@@ -237,7 +238,7 @@ defm prefix_symbols
: Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
MetaVarName<"prefix">;
-def version : Flag<["-", "--"], "version">,
+def version : Flag<["--"], "version">,
HelpText<"Print the version and exit.">;
def V : Flag<["-"], "V">, Alias<version>;
defm build_id_link_dir
@@ -254,7 +255,7 @@ defm build_id_link_output
MetaVarName<"suffix">;
def regex
- : Flag<["-", "--"], "regex">,
+ : Flag<["--"], "regex">,
HelpText<"Permit regular expressions in name comparison">;
defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
@@ -264,7 +265,7 @@ defm change_start : Eq<"change-start", "Add <incr> to the start address. Can be
"specified multiple times, all values will be applied "
"cumulatively.">,
MetaVarName<"incr">;
-def adjust_start : JoinedOrSeparate<["-", "--"], "adjust-start">,
+def adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
Alias<change_start>;
defm add_symbol
diff --git a/llvm/tools/llvm-objcopy/StripOpts.td b/llvm/tools/llvm-objcopy/StripOpts.td
index 3bb41ae..99ce3c2 100644
--- a/llvm/tools/llvm-objcopy/StripOpts.td
+++ b/llvm/tools/llvm-objcopy/StripOpts.td
@@ -1,22 +1,23 @@
include "llvm/Option/OptParser.td"
multiclass Eq<string name, string help> {
- def NAME : Separate<["--", "-"], name>;
- def NAME #_eq : Joined<["--", "-"], name #"=">,
+ def NAME : Separate<["--"], name>;
+ def NAME #_eq : Joined<["--"], name #"=">,
Alias<!cast<Separate>(NAME)>,
HelpText<help>;
}
-def help : Flag<["-", "--"], "help">;
+def help : Flag<["--"], "help">;
+def h : Flag<["-"], "h">, Alias<help>;
def allow_broken_links
- : Flag<["-", "--"], "allow-broken-links">,
+ : Flag<["--"], "allow-broken-links">,
HelpText<"Allow llvm-strip to remove sections even if it would leave "
"invalid section references. The appropriate sh_link fields"
"will be set to zero.">;
def enable_deterministic_archives
- : Flag<["-", "--"], "enable-deterministic-archives">,
+ : Flag<["--"], "enable-deterministic-archives">,
HelpText<"Enable deterministic mode when stripping archives (use zero "
"for UIDs, GIDs, and timestamps).">;
def D : Flag<["-"], "D">,
@@ -24,32 +25,32 @@ def D : Flag<["-"], "D">,
HelpText<"Alias for --enable-deterministic-archives">;
def disable_deterministic_archives
- : Flag<["-", "--"], "disable-deterministic-archives">,
+ : Flag<["--"], "disable-deterministic-archives">,
HelpText<"Disable deterministic mode when stripping archives (use real "
"values for UIDs, GIDs, and timestamps).">;
def U : Flag<["-"], "U">,
Alias<disable_deterministic_archives>,
HelpText<"Alias for --disable-deterministic-archives">;
-defm output : Eq<"o", "Write output to <file>">, MetaVarName<"output">;
+def output : JoinedOrSeparate<["-"], "o">, HelpText<"Write output to <file>">;
-def preserve_dates : Flag<["-", "--"], "preserve-dates">,
+def preserve_dates : Flag<["--"], "preserve-dates">,
HelpText<"Preserve access and modification timestamps">;
def p : Flag<["-"], "p">, Alias<preserve_dates>;
-def strip_all : Flag<["-", "--"], "strip-all">,
+def strip_all : Flag<["--"], "strip-all">,
HelpText<"Remove non-allocated sections outside segments. "
".gnu.warning* sections are not removed">;
def s : Flag<["-"], "s">, Alias<strip_all>;
-def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
+def strip_all_gnu : Flag<["--"], "strip-all-gnu">,
HelpText<"Compatible with GNU strip's --strip-all">;
-def strip_debug : Flag<["-", "--"], "strip-debug">,
+def strip_debug : Flag<["--"], "strip-debug">,
HelpText<"Remove debugging symbols only">;
def d : Flag<["-"], "d">, Alias<strip_debug>;
def g : Flag<["-"], "g">, Alias<strip_debug>;
def S : Flag<["-"], "S">, Alias<strip_debug>;
-def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
+def strip_unneeded : Flag<["--"], "strip-unneeded">,
HelpText<"Remove all symbols not needed by relocations">;
defm remove_section : Eq<"remove-section", "Remove <section>">,
@@ -64,30 +65,30 @@ defm keep_section : Eq<"keep-section", "Keep <section>">,
MetaVarName<"section">;
defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">,
MetaVarName<"symbol">;
-def keep_file_symbols : Flag<["-", "--"], "keep-file-symbols">,
+def keep_file_symbols : Flag<["--"], "keep-file-symbols">,
HelpText<"Do not remove file symbols">;
def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>;
def only_keep_debug
- : Flag<["-", "--"], "only-keep-debug">,
+ : Flag<["--"], "only-keep-debug">,
HelpText<"Clear sections that would not be stripped by --strip-debug. "
"Currently only implemented for COFF.">;
-def discard_locals : Flag<["-", "--"], "discard-locals">,
+def discard_locals : Flag<["--"], "discard-locals">,
HelpText<"Remove compiler-generated local symbols, (e.g. "
"symbols starting with .L)">;
def X : Flag<["-"], "X">, Alias<discard_locals>;
def discard_all
- : Flag<["-", "--"], "discard-all">,
+ : Flag<["--"], "discard-all">,
HelpText<"Remove all local symbols except file and section symbols">;
def x : Flag<["-"], "x">, Alias<discard_all>;
def regex
- : Flag<["-", "--"], "regex">,
+ : Flag<["--"], "regex">,
HelpText<"Permit regular expressions in name comparison">;
-def version : Flag<["-", "--"], "version">,
+def version : Flag<["--"], "version">,
HelpText<"Print the version and exit.">;
def V : Flag<["-"], "V">, Alias<version>;