mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-14 05:20:30 +00:00
[llvm-objcopy] Move duplicate tablegen from objcopy and strip into one file
Summary: This avoids maintaining the same options in two different places. Reviewers: jhenderson, alexshap, rupprecht, MaskRay Reviewed By: jhenderson, rupprecht, MaskRay Subscribers: MaskRay, wolfgangp, jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65991 llvm-svn: 368961
This commit is contained in:
parent
03772ca789
commit
40deb5ad19
113
tools/llvm-objcopy/CommonOpts.td
Normal file
113
tools/llvm-objcopy/CommonOpts.td
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
include "llvm/Option/OptParser.td"
|
||||||
|
|
||||||
|
multiclass Eq<string name, string help> {
|
||||||
|
def NAME : Separate<["--"], name>;
|
||||||
|
def NAME #_eq : Joined<["--"], name #"=">,
|
||||||
|
Alias<!cast<Separate>(NAME)>,
|
||||||
|
HelpText<help>;
|
||||||
|
}
|
||||||
|
|
||||||
|
def help : Flag<["--"], "help">;
|
||||||
|
def h : Flag<["-"], "h">, Alias<help>;
|
||||||
|
|
||||||
|
def allow_broken_links
|
||||||
|
: Flag<["--"], "allow-broken-links">,
|
||||||
|
HelpText<"Allow the tool 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">,
|
||||||
|
HelpText<"Enable deterministic mode when operating on archives (use "
|
||||||
|
"zero for UIDs, GIDs, and timestamps).">;
|
||||||
|
def D : Flag<["-"], "D">,
|
||||||
|
Alias<enable_deterministic_archives>,
|
||||||
|
HelpText<"Alias for --enable-deterministic-archives">;
|
||||||
|
|
||||||
|
def disable_deterministic_archives
|
||||||
|
: Flag<["--"], "disable-deterministic-archives">,
|
||||||
|
HelpText<"Disable deterministic mode when operating on 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">,
|
||||||
|
HelpText<"Preserve access and modification timestamps">;
|
||||||
|
def p : Flag<["-"], "p">,
|
||||||
|
Alias<preserve_dates>,
|
||||||
|
HelpText<"Alias for --preserve-dates">;
|
||||||
|
|
||||||
|
def strip_all : Flag<["--"], "strip-all">,
|
||||||
|
HelpText<"Remove non-allocated sections outside segments. "
|
||||||
|
".gnu.warning* sections are not removed">;
|
||||||
|
|
||||||
|
def strip_all_gnu
|
||||||
|
: Flag<["--"], "strip-all-gnu">,
|
||||||
|
HelpText<"Compatible with GNU's --strip-all">;
|
||||||
|
|
||||||
|
def strip_debug : Flag<["--"], "strip-debug">,
|
||||||
|
HelpText<"Remove all debug sections">;
|
||||||
|
def g : Flag<["-"], "g">,
|
||||||
|
Alias<strip_debug>,
|
||||||
|
HelpText<"Alias for --strip-debug">;
|
||||||
|
|
||||||
|
def strip_unneeded : Flag<["--"], "strip-unneeded">,
|
||||||
|
HelpText<"Remove all symbols not needed by relocations">;
|
||||||
|
|
||||||
|
defm remove_section : Eq<"remove-section", "Remove <section>">,
|
||||||
|
MetaVarName<"section">;
|
||||||
|
def R : JoinedOrSeparate<["-"], "R">,
|
||||||
|
Alias<remove_section>,
|
||||||
|
HelpText<"Alias for --remove-section">;
|
||||||
|
|
||||||
|
def strip_sections
|
||||||
|
: Flag<["--"], "strip-sections">,
|
||||||
|
HelpText<"Remove all section headers and all sections not in segments">;
|
||||||
|
|
||||||
|
defm strip_symbol : Eq<"strip-symbol", "Strip <symbol>">,
|
||||||
|
MetaVarName<"symbol">;
|
||||||
|
def N : JoinedOrSeparate<["-"], "N">,
|
||||||
|
Alias<strip_symbol>,
|
||||||
|
HelpText<"Alias for --strip-symbol">;
|
||||||
|
|
||||||
|
defm keep_section : Eq<"keep-section", "Keep <section>">,
|
||||||
|
MetaVarName<"section">;
|
||||||
|
|
||||||
|
defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">,
|
||||||
|
MetaVarName<"symbol">;
|
||||||
|
def K : JoinedOrSeparate<["-"], "K">,
|
||||||
|
Alias<keep_symbol>,
|
||||||
|
HelpText<"Alias for --keep-symbol">;
|
||||||
|
|
||||||
|
def keep_file_symbols : Flag<["--"], "keep-file-symbols">,
|
||||||
|
HelpText<"Do not remove file symbols">;
|
||||||
|
|
||||||
|
def 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">,
|
||||||
|
HelpText<"Remove compiler-generated local symbols, (e.g. "
|
||||||
|
"symbols starting with .L)">;
|
||||||
|
def X : Flag<["-"], "X">,
|
||||||
|
Alias<discard_locals>,
|
||||||
|
HelpText<"Alias for --discard-locals">;
|
||||||
|
|
||||||
|
def discard_all
|
||||||
|
: Flag<["--"], "discard-all">,
|
||||||
|
HelpText<"Remove all local symbols except file and section symbols">;
|
||||||
|
def x : Flag<["-"], "x">,
|
||||||
|
Alias<discard_all>,
|
||||||
|
HelpText<"Alias for --discard-all">;
|
||||||
|
|
||||||
|
def regex
|
||||||
|
: Flag<["--"], "regex">,
|
||||||
|
HelpText<"Permit regular expressions in name comparison">;
|
||||||
|
|
||||||
|
def version : Flag<["--"], "version">,
|
||||||
|
HelpText<"Print the version and exit.">;
|
||||||
|
def V : Flag<["-"], "V">,
|
||||||
|
Alias<version>,
|
||||||
|
HelpText<"Alias for --version">;
|
@ -1,37 +1,29 @@
|
|||||||
include "llvm/Option/OptParser.td"
|
include "CommonOpts.td"
|
||||||
|
|
||||||
multiclass Eq<string name, string help> {
|
|
||||||
def NAME : Separate<["--"], name>;
|
|
||||||
def NAME #_eq : Joined<["--"], name #"=">,
|
|
||||||
Alias<!cast<Separate>(NAME)>,
|
|
||||||
HelpText<help>;
|
|
||||||
}
|
|
||||||
|
|
||||||
def help : Flag<["--"], "help">;
|
|
||||||
def h : Flag<["-"], "h">, Alias<help>;
|
|
||||||
|
|
||||||
def 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.">;
|
|
||||||
|
|
||||||
defm binary_architecture
|
defm binary_architecture
|
||||||
: Eq<"binary-architecture", "Used when transforming an architecture-less "
|
: Eq<"binary-architecture", "Used when transforming an architecture-less "
|
||||||
"format (such as binary) to another format">;
|
"format (such as binary) to another format">;
|
||||||
def B : JoinedOrSeparate<["-"], "B">, Alias<binary_architecture>;
|
def B : JoinedOrSeparate<["-"], "B">,
|
||||||
|
Alias<binary_architecture>,
|
||||||
|
HelpText<"Alias for --binary-architecture">;
|
||||||
|
|
||||||
defm target : Eq<"target", "Format of the input and output file">,
|
defm target : Eq<"target", "Format of the input and output file">,
|
||||||
Values<"binary">;
|
Values<"binary">;
|
||||||
def F : JoinedOrSeparate<["-"], "F">, Alias<target>;
|
def F : JoinedOrSeparate<["-"], "F">,
|
||||||
|
Alias<target>,
|
||||||
|
HelpText<"Alias for --target">;
|
||||||
|
|
||||||
defm input_target : Eq<"input-target", "Format of the input file">,
|
defm input_target : Eq<"input-target", "Format of the input file">,
|
||||||
Values<"binary">;
|
Values<"binary">;
|
||||||
def I : JoinedOrSeparate<["-"], "I">, Alias<input_target>;
|
def I : JoinedOrSeparate<["-"], "I">,
|
||||||
|
Alias<input_target>,
|
||||||
|
HelpText<"Alias for --input-target">;
|
||||||
|
|
||||||
defm output_target : Eq<"output-target", "Format of the output file">,
|
defm output_target : Eq<"output-target", "Format of the output file">,
|
||||||
Values<"binary">;
|
Values<"binary">;
|
||||||
def O : JoinedOrSeparate<["-"], "O">, Alias<output_target>;
|
def O : JoinedOrSeparate<["-"], "O">,
|
||||||
|
Alias<output_target>,
|
||||||
|
HelpText<"Alias for --output-target">;
|
||||||
|
|
||||||
def compress_debug_sections : Flag<["--"], "compress-debug-sections">;
|
def compress_debug_sections : Flag<["--"], "compress-debug-sections">;
|
||||||
def compress_debug_sections_eq
|
def compress_debug_sections_eq
|
||||||
@ -46,34 +38,10 @@ defm split_dwo
|
|||||||
"<dwo-file>, then strip-dwo on the input file">,
|
"<dwo-file>, then strip-dwo on the input file">,
|
||||||
MetaVarName<"dwo-file">;
|
MetaVarName<"dwo-file">;
|
||||||
|
|
||||||
def 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">,
|
|
||||||
Alias<enable_deterministic_archives>,
|
|
||||||
HelpText<"Alias for --enable-deterministic-archives">;
|
|
||||||
|
|
||||||
def 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">,
|
|
||||||
HelpText<"Preserve access and modification timestamps">;
|
|
||||||
def p : Flag<["-"], "p">, Alias<preserve_dates>;
|
|
||||||
|
|
||||||
defm add_gnu_debuglink
|
defm add_gnu_debuglink
|
||||||
: Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
|
: Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
|
||||||
MetaVarName<"debug-file">;
|
MetaVarName<"debug-file">;
|
||||||
|
|
||||||
defm remove_section : Eq<"remove-section", "Remove <section>">,
|
|
||||||
MetaVarName<"section">;
|
|
||||||
def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>;
|
|
||||||
|
|
||||||
defm rename_section
|
defm rename_section
|
||||||
: Eq<"rename-section",
|
: Eq<"rename-section",
|
||||||
"Renames a section from old to new, optionally with specified flags. "
|
"Renames a section from old to new, optionally with specified flags. "
|
||||||
@ -93,11 +61,11 @@ defm redefine_symbols
|
|||||||
"symbols from many files.">,
|
"symbols from many files.">,
|
||||||
MetaVarName<"filename">;
|
MetaVarName<"filename">;
|
||||||
|
|
||||||
defm keep_section : Eq<"keep-section", "Keep <section>">,
|
|
||||||
MetaVarName<"section">;
|
|
||||||
defm only_section : Eq<"only-section", "Remove all but <section>">,
|
defm only_section : Eq<"only-section", "Remove all but <section>">,
|
||||||
MetaVarName<"section">;
|
MetaVarName<"section">;
|
||||||
def j : JoinedOrSeparate<["-"], "j">, Alias<only_section>;
|
def j : JoinedOrSeparate<["-"], "j">,
|
||||||
|
Alias<only_section>,
|
||||||
|
HelpText<"Alias for --only-section">;
|
||||||
defm add_section
|
defm add_section
|
||||||
: Eq<"add-section",
|
: Eq<"add-section",
|
||||||
"Make a section named <section> with the contents of <file>.">,
|
"Make a section named <section> with the contents of <file>.">,
|
||||||
@ -110,26 +78,14 @@ defm set_section_flags
|
|||||||
"rom, share, contents, merge, strings.">,
|
"rom, share, contents, merge, strings.">,
|
||||||
MetaVarName<"section=flag1[,flag2,...]">;
|
MetaVarName<"section=flag1[,flag2,...]">;
|
||||||
|
|
||||||
def strip_all : Flag<["--"], "strip-all">,
|
def S : Flag<["-"], "S">,
|
||||||
HelpText<"Remove non-allocated sections outside segments. "
|
Alias<strip_all>,
|
||||||
".gnu.warning* sections are not removed">;
|
HelpText<"Alias for --strip-all">;
|
||||||
def S : Flag<["-"], "S">, Alias<strip_all>;
|
|
||||||
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">,
|
def strip_dwo : Flag<["--"], "strip-dwo">,
|
||||||
HelpText<"Remove all DWARF .dwo sections from file">;
|
HelpText<"Remove all DWARF .dwo sections from file">;
|
||||||
def strip_sections
|
|
||||||
: Flag<["--"], "strip-sections">,
|
|
||||||
HelpText<"Remove all section headers and all sections not in segments">;
|
|
||||||
def strip_non_alloc
|
def strip_non_alloc
|
||||||
: Flag<["--"], "strip-non-alloc">,
|
: Flag<["--"], "strip-non-alloc">,
|
||||||
HelpText<"Remove all non-allocated sections outside segments">;
|
HelpText<"Remove all non-allocated sections outside segments">;
|
||||||
def strip_unneeded : Flag<["--"], "strip-unneeded">,
|
|
||||||
HelpText<"Remove all symbols not needed by relocations">;
|
|
||||||
defm strip_unneeded_symbol
|
defm strip_unneeded_symbol
|
||||||
: Eq<"strip-unneeded-symbol",
|
: Eq<"strip-unneeded-symbol",
|
||||||
"Remove symbol <symbol> if it is not needed by relocations">,
|
"Remove symbol <symbol> if it is not needed by relocations">,
|
||||||
@ -163,7 +119,9 @@ defm localize_symbols
|
|||||||
"Reads a list of symbols from <filename> and marks them local.">,
|
"Reads a list of symbols from <filename> and marks them local.">,
|
||||||
MetaVarName<"filename">;
|
MetaVarName<"filename">;
|
||||||
|
|
||||||
def L : JoinedOrSeparate<["-"], "L">, Alias<localize_symbol>;
|
def L : JoinedOrSeparate<["-"], "L">,
|
||||||
|
Alias<localize_symbol>,
|
||||||
|
HelpText<"Alias for --localize-symbol">;
|
||||||
|
|
||||||
defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
|
defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
|
||||||
MetaVarName<"symbol">;
|
MetaVarName<"symbol">;
|
||||||
@ -178,7 +136,9 @@ defm keep_global_symbol
|
|||||||
"Convert all symbols except <symbol> to local. May be repeated to "
|
"Convert all symbols except <symbol> to local. May be repeated to "
|
||||||
"convert all except a set of symbols to local.">,
|
"convert all except a set of symbols to local.">,
|
||||||
MetaVarName<"symbol">;
|
MetaVarName<"symbol">;
|
||||||
def G : JoinedOrSeparate<["-"], "G">, Alias<keep_global_symbol>;
|
def G : JoinedOrSeparate<["-"], "G">,
|
||||||
|
Alias<keep_global_symbol>,
|
||||||
|
HelpText<"Alias for --keep-global-symbol">;
|
||||||
|
|
||||||
defm keep_global_symbols
|
defm keep_global_symbols
|
||||||
: Eq<"keep-global-symbols",
|
: Eq<"keep-global-symbols",
|
||||||
@ -196,31 +156,17 @@ defm weaken_symbols
|
|||||||
"Reads a list of symbols from <filename> and marks them weak.">,
|
"Reads a list of symbols from <filename> and marks them weak.">,
|
||||||
MetaVarName<"filename">;
|
MetaVarName<"filename">;
|
||||||
|
|
||||||
def W : JoinedOrSeparate<["-"], "W">, Alias<weaken_symbol>;
|
def W : JoinedOrSeparate<["-"], "W">,
|
||||||
|
Alias<weaken_symbol>,
|
||||||
|
HelpText<"Alias for --weaken-symbol">;
|
||||||
def weaken : Flag<["--"], "weaken">,
|
def weaken : Flag<["--"], "weaken">,
|
||||||
HelpText<"Mark all global symbols as weak">;
|
HelpText<"Mark all global symbols as weak">;
|
||||||
|
|
||||||
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">,
|
|
||||||
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>">,
|
|
||||||
MetaVarName<"symbol">;
|
|
||||||
defm strip_symbols
|
defm strip_symbols
|
||||||
: Eq<"strip-symbols",
|
: Eq<"strip-symbols",
|
||||||
"Reads a list of symbols from <filename> and removes them.">,
|
"Reads a list of symbols from <filename> and removes them.">,
|
||||||
MetaVarName<"filename">;
|
MetaVarName<"filename">;
|
||||||
|
|
||||||
def N : JoinedOrSeparate<["-"], "N">, Alias<strip_symbol>;
|
|
||||||
defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">,
|
|
||||||
MetaVarName<"symbol">;
|
|
||||||
def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>;
|
|
||||||
|
|
||||||
defm keep_symbols
|
defm keep_symbols
|
||||||
: Eq<"keep-symbols",
|
: Eq<"keep-symbols",
|
||||||
"Reads a list of symbols from <filename> and runs as if "
|
"Reads a list of symbols from <filename> and runs as if "
|
||||||
@ -230,13 +176,6 @@ defm keep_symbols
|
|||||||
"be repeated to read symbols from many files.">,
|
"be repeated to read symbols from many files.">,
|
||||||
MetaVarName<"filename">;
|
MetaVarName<"filename">;
|
||||||
|
|
||||||
def 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">,
|
|
||||||
HelpText<"Do not remove file symbols">;
|
|
||||||
defm dump_section
|
defm dump_section
|
||||||
: Eq<"dump-section",
|
: Eq<"dump-section",
|
||||||
"Dump contents of section named <section> into file <file>">,
|
"Dump contents of section named <section> into file <file>">,
|
||||||
@ -249,9 +188,6 @@ defm prefix_alloc_sections
|
|||||||
: Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
|
: Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
|
||||||
MetaVarName<"prefix">;
|
MetaVarName<"prefix">;
|
||||||
|
|
||||||
def version : Flag<["--"], "version">,
|
|
||||||
HelpText<"Print the version and exit.">;
|
|
||||||
def V : Flag<["-"], "V">, Alias<version>;
|
|
||||||
defm build_id_link_dir
|
defm build_id_link_dir
|
||||||
: Eq<"build-id-link-dir", "Set directory for --build-id-link-input and "
|
: Eq<"build-id-link-dir", "Set directory for --build-id-link-input and "
|
||||||
"--build-id-link-output to <dir>">,
|
"--build-id-link-output to <dir>">,
|
||||||
@ -265,10 +201,6 @@ defm build_id_link_output
|
|||||||
"name derived from hex build ID">,
|
"name derived from hex build ID">,
|
||||||
MetaVarName<"suffix">;
|
MetaVarName<"suffix">;
|
||||||
|
|
||||||
def regex
|
|
||||||
: Flag<["--"], "regex">,
|
|
||||||
HelpText<"Permit regular expressions in name comparison">;
|
|
||||||
|
|
||||||
defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
|
defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
|
||||||
"any previous --change-start or --adjust-start values.">,
|
"any previous --change-start or --adjust-start values.">,
|
||||||
MetaVarName<"addr">;
|
MetaVarName<"addr">;
|
||||||
@ -277,7 +209,8 @@ defm change_start : Eq<"change-start", "Add <incr> to the start address. Can be
|
|||||||
"cumulatively.">,
|
"cumulatively.">,
|
||||||
MetaVarName<"incr">;
|
MetaVarName<"incr">;
|
||||||
def adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
|
def adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
|
||||||
Alias<change_start>;
|
Alias<change_start>,
|
||||||
|
HelpText<"Alias for --change-start">;
|
||||||
|
|
||||||
defm add_symbol
|
defm add_symbol
|
||||||
: Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
|
: Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
|
||||||
|
@ -1,99 +1,17 @@
|
|||||||
include "llvm/Option/OptParser.td"
|
include "CommonOpts.td"
|
||||||
|
|
||||||
multiclass Eq<string name, string help> {
|
def output : JoinedOrSeparate<["-"], "o">, HelpText<"Write output to <file>">,
|
||||||
def NAME : Separate<["--"], name>;
|
MetaVarName<"<file>">;
|
||||||
def NAME #_eq : Joined<["--"], name #"=">,
|
|
||||||
Alias<!cast<Separate>(NAME)>,
|
|
||||||
HelpText<help>;
|
|
||||||
}
|
|
||||||
|
|
||||||
def help : Flag<["--"], "help">;
|
def s : Flag<["-"], "s">,
|
||||||
def h : Flag<["-"], "h">, Alias<help>;
|
Alias<strip_all>,
|
||||||
|
HelpText<"Alias for --strip-all">;
|
||||||
def 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">,
|
|
||||||
HelpText<"Enable deterministic mode when stripping archives (use zero "
|
|
||||||
"for UIDs, GIDs, and timestamps).">;
|
|
||||||
def D : Flag<["-"], "D">,
|
|
||||||
Alias<enable_deterministic_archives>,
|
|
||||||
HelpText<"Alias for --enable-deterministic-archives">;
|
|
||||||
|
|
||||||
def 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">;
|
|
||||||
|
|
||||||
def output : JoinedOrSeparate<["-"], "o">, HelpText<"Write output to <file>">;
|
|
||||||
|
|
||||||
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">,
|
|
||||||
HelpText<"Remove non-allocated sections outside segments. "
|
|
||||||
".gnu.warning* sections are not removed">;
|
|
||||||
def s : Flag<["-"], "s">, Alias<strip_all>;
|
|
||||||
def no_strip_all : Flag<["--"], "no-strip-all">,
|
def no_strip_all : Flag<["--"], "no-strip-all">,
|
||||||
HelpText<"Disable --strip-all">;
|
HelpText<"Disable --strip-all">;
|
||||||
|
|
||||||
def strip_all_gnu : Flag<["--"], "strip-all-gnu">,
|
def d : Flag<["-"], "d">,
|
||||||
HelpText<"Compatible with GNU strip's --strip-all">;
|
Alias<strip_debug>,
|
||||||
def strip_debug : Flag<["--"], "strip-debug">,
|
HelpText<"Alias for --strip-debug">;
|
||||||
HelpText<"Remove debugging symbols only">;
|
def S : Flag<["-"], "S">,
|
||||||
def d : Flag<["-"], "d">, Alias<strip_debug>;
|
Alias<strip_debug>,
|
||||||
def g : Flag<["-"], "g">, Alias<strip_debug>;
|
HelpText<"Alias for --strip-debug">;
|
||||||
def S : Flag<["-"], "S">, Alias<strip_debug>;
|
|
||||||
def strip_sections
|
|
||||||
: Flag<["--"], "strip-sections">,
|
|
||||||
HelpText<"Remove all section headers and all sections not in segments">;
|
|
||||||
def strip_unneeded : Flag<["--"], "strip-unneeded">,
|
|
||||||
HelpText<"Remove all symbols not needed by relocations">;
|
|
||||||
|
|
||||||
defm remove_section : Eq<"remove-section", "Remove <section>">,
|
|
||||||
MetaVarName<"section">;
|
|
||||||
def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>;
|
|
||||||
|
|
||||||
defm strip_symbol : Eq<"strip-symbol", "Strip <symbol>">,
|
|
||||||
MetaVarName<"symbol">;
|
|
||||||
def N : JoinedOrSeparate<["-"], "N">, Alias<strip_symbol>;
|
|
||||||
|
|
||||||
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">,
|
|
||||||
HelpText<"Do not remove file symbols">;
|
|
||||||
|
|
||||||
def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>;
|
|
||||||
|
|
||||||
def 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">,
|
|
||||||
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">,
|
|
||||||
HelpText<"Remove all local symbols except file and section symbols">;
|
|
||||||
def x : Flag<["-"], "x">, Alias<discard_all>;
|
|
||||||
|
|
||||||
def regex
|
|
||||||
: Flag<["--"], "regex">,
|
|
||||||
HelpText<"Permit regular expressions in name comparison">;
|
|
||||||
|
|
||||||
def version : Flag<["--"], "version">,
|
|
||||||
HelpText<"Print the version and exit.">;
|
|
||||||
def V : Flag<["-"], "V">, Alias<version>;
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user