2018-04-24 13:43:32 +08:00
|
|
|
include "llvm/Option/OptParser.td"
|
|
|
|
|
|
|
|
multiclass Eq<string name> {
|
|
|
|
def NAME: Separate<["--", "-"], name>;
|
|
|
|
def NAME # _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>;
|
|
|
|
}
|
|
|
|
|
|
|
|
def help : Flag<["-", "--"], "help">;
|
|
|
|
defm binary_architecture : Eq<"binary-architecture">,
|
|
|
|
HelpText<"Used when transforming an architecture-less format (such as binary) to another format">;
|
|
|
|
def B : JoinedOrSeparate<["-"], "B">,
|
|
|
|
Alias<binary_architecture>;
|
|
|
|
defm input_target : Eq<"input-target">,
|
|
|
|
HelpText<"Format of the input file">,
|
|
|
|
Values<"binary">;
|
2018-08-02 04:59:39 +08:00
|
|
|
def I : JoinedOrSeparate<[ "-" ], "I">, Alias<input_target>;
|
2018-04-24 13:43:32 +08:00
|
|
|
defm output_target : Eq<"output-target">,
|
|
|
|
HelpText<"Format of the output file">,
|
|
|
|
Values<"binary">;
|
|
|
|
def O : JoinedOrSeparate<["-"], "O">,
|
|
|
|
Alias<output_target>;
|
|
|
|
defm split_dwo : Eq<"split-dwo">,
|
|
|
|
MetaVarName<"dwo-file">,
|
|
|
|
HelpText<"Equivalent to extract-dwo on the input file to <dwo-file>, then strip-dwo on the input file">;
|
|
|
|
defm add_gnu_debuglink : Eq<"add-gnu-debuglink">,
|
|
|
|
MetaVarName<"debug-file">,
|
2018-04-25 05:44:13 +08:00
|
|
|
HelpText<"Add a .gnu_debuglink for <debug-file>">;
|
2018-04-24 13:43:32 +08:00
|
|
|
defm remove_section : Eq<"remove-section">,
|
|
|
|
MetaVarName<"section">,
|
|
|
|
HelpText<"Remove <section>">;
|
2018-08-02 00:23:22 +08:00
|
|
|
defm rename_section
|
|
|
|
: Eq<"rename-section">,
|
|
|
|
MetaVarName<"old=new[,flag1,...]">,
|
|
|
|
HelpText<
|
|
|
|
"Renames a section from old to new, optionally with specified flags. "
|
|
|
|
"Flags supported for GNU compatibility: alloc, load, noload, "
|
|
|
|
"readonly, debug, code, data, rom, share, contents, merge, strings.">;
|
2018-04-27 02:28:17 +08:00
|
|
|
defm redefine_symbol : Eq<"redefine-sym">,
|
|
|
|
MetaVarName<"old=new">,
|
|
|
|
HelpText<"Change the name of a symbol old to new">;
|
2018-04-24 13:43:32 +08:00
|
|
|
def R : JoinedOrSeparate<["-"], "R">,
|
|
|
|
Alias<remove_section>;
|
|
|
|
defm keep : Eq<"keep">,
|
|
|
|
MetaVarName<"section">,
|
|
|
|
HelpText<"Keep <section>">;
|
|
|
|
defm only_keep : Eq<"only-keep">,
|
|
|
|
MetaVarName<"section">,
|
|
|
|
HelpText<"Remove all but <section>">;
|
|
|
|
def j : JoinedOrSeparate<["-"], "j">,
|
|
|
|
Alias<only_keep>;
|
|
|
|
defm add_section : Eq<"add-section">,
|
|
|
|
MetaVarName<"section=file">,
|
|
|
|
HelpText<"Make a section named <section> with the contents of <file>.">;
|
|
|
|
def strip_all : Flag<["-", "--"], "strip-all">,
|
2018-04-25 05:44:13 +08:00
|
|
|
HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
|
2018-04-24 13:43:32 +08:00
|
|
|
def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
|
|
|
|
HelpText<"Compaitable with GNU objcopy's --strip-all">;
|
|
|
|
def strip_debug : Flag<["-", "--"], "strip-debug">,
|
2018-04-25 05:44:13 +08:00
|
|
|
HelpText<"Remove all debug information">;
|
2018-04-24 13:43:32 +08:00
|
|
|
def strip_dwo : Flag<["-", "--"], "strip-dwo">,
|
|
|
|
HelpText<"Remove all DWARF .dwo sections from file">;
|
|
|
|
def strip_sections : Flag<["-", "--"], "strip-sections">,
|
|
|
|
HelpText<"Remove all section headers">;
|
|
|
|
def strip_non_alloc : Flag<["-", "--"], "strip-non-alloc">,
|
|
|
|
HelpText<"Remove all non-allocated sections">;
|
|
|
|
def extract_dwo : Flag<["-", "--"], "extract-dwo">,
|
|
|
|
HelpText<"Remove all sections that are not DWARF .dwo sections from file">;
|
|
|
|
def localize_hidden : Flag<["-", "--"], "localize-hidden">,
|
|
|
|
HelpText<"Mark all symbols that have hidden or internal visibility as local">;
|
2018-04-27 01:44:43 +08:00
|
|
|
defm localize_symbol : Eq<"localize-symbol">,
|
2018-04-27 02:28:17 +08:00
|
|
|
MetaVarName<"symbol">,
|
|
|
|
HelpText<"Mark <symbol> as local">;
|
2018-04-27 01:44:43 +08:00
|
|
|
def L : JoinedOrSeparate<["-"], "L">,
|
|
|
|
Alias<localize_symbol>;
|
2018-04-28 03:09:44 +08:00
|
|
|
defm globalize_symbol : Eq<"globalize-symbol">,
|
|
|
|
MetaVarName<"symbol">,
|
|
|
|
HelpText<"Mark <symbol> as global">;
|
2018-04-28 03:16:27 +08:00
|
|
|
defm weaken_symbol : Eq<"weaken-symbol">,
|
|
|
|
MetaVarName<"symbol">,
|
|
|
|
HelpText<"Mark <symbol> as weak">;
|
|
|
|
def W : JoinedOrSeparate<["-"], "W">,
|
|
|
|
Alias<weaken_symbol>;
|
2018-05-03 04:14:49 +08:00
|
|
|
def weaken : Flag<["-", "--"], "weaken">,
|
|
|
|
HelpText<"Mark all global symbols as weak">;
|
2018-05-03 04:19:22 +08:00
|
|
|
def discard_all : Flag<["-", "--"], "discard-all">,
|
|
|
|
HelpText<"Remove all local symbols except file and section symbols">;
|
|
|
|
def x : Flag<["-"], "x">,
|
|
|
|
Alias<discard_all>;
|
2018-05-10 05:36:54 +08:00
|
|
|
defm strip_symbol : Eq<"strip-symbol">,
|
|
|
|
MetaVarName<"symbol">,
|
|
|
|
HelpText<"Remove symbol <symbol>">;
|
|
|
|
def N : JoinedOrSeparate<["-"], "N">,
|
|
|
|
Alias<strip_symbol>;
|
2018-05-15 22:09:37 +08:00
|
|
|
defm keep_symbol : Eq<"keep-symbol">,
|
|
|
|
MetaVarName<"symbol">,
|
|
|
|
HelpText<"Do not remove symbol <symbol>">;
|
|
|
|
def K : JoinedOrSeparate<["-"], "K">,
|
|
|
|
Alias<keep_symbol>;
|
2018-05-16 04:53:53 +08:00
|
|
|
def only_keep_debug : Flag<["-", "--"], "only-keep-debug">,
|
|
|
|
HelpText<"Currently ignored. Only for compaitability with GNU objcopy.">;
|
2018-05-25 19:01:25 +08:00
|
|
|
def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
|
|
|
|
HelpText<"Remove all symbols not needed by relocations">;
|
2018-05-26 16:10:37 +08:00
|
|
|
def keep_file_symbols : Flag<["-", "--"], "keep-file-symbols">,
|
|
|
|
HelpText<"Do not remove file symbols">;
|