blob: 628859679933b6837b5de6baf33e41afba9e0441 [file] [log] [blame]
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +00001include "llvm/Option/OptParser.td"
2
3multiclass Eq<string name> {
4 def NAME: Separate<["--", "-"], name>;
5 def NAME # _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>;
6}
7
8def help : Flag<["-", "--"], "help">;
9defm binary_architecture : Eq<"binary-architecture">,
10 HelpText<"Used when transforming an architecture-less format (such as binary) to another format">;
11def B : JoinedOrSeparate<["-"], "B">,
12 Alias<binary_architecture>;
13defm input_target : Eq<"input-target">,
14 HelpText<"Format of the input file">,
15 Values<"binary">;
16defm output_target : Eq<"output-target">,
17 HelpText<"Format of the output file">,
18 Values<"binary">;
19def O : JoinedOrSeparate<["-"], "O">,
20 Alias<output_target>;
21defm split_dwo : Eq<"split-dwo">,
22 MetaVarName<"dwo-file">,
23 HelpText<"Equivalent to extract-dwo on the input file to <dwo-file>, then strip-dwo on the input file">;
24defm add_gnu_debuglink : Eq<"add-gnu-debuglink">,
25 MetaVarName<"debug-file">,
Alexander Shaposhnikovb3bfd3b2018-04-24 21:44:13 +000026 HelpText<"Add a .gnu_debuglink for <debug-file>">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000027defm remove_section : Eq<"remove-section">,
28 MetaVarName<"section">,
29 HelpText<"Remove <section>">;
Alexander Shaposhnikov40e9bdf2018-04-26 18:28:17 +000030defm redefine_symbol : Eq<"redefine-sym">,
31 MetaVarName<"old=new">,
32 HelpText<"Change the name of a symbol old to new">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000033def R : JoinedOrSeparate<["-"], "R">,
34 Alias<remove_section>;
35defm keep : Eq<"keep">,
36 MetaVarName<"section">,
37 HelpText<"Keep <section>">;
38defm only_keep : Eq<"only-keep">,
39 MetaVarName<"section">,
40 HelpText<"Remove all but <section>">;
41def j : JoinedOrSeparate<["-"], "j">,
42 Alias<only_keep>;
43defm add_section : Eq<"add-section">,
44 MetaVarName<"section=file">,
45 HelpText<"Make a section named <section> with the contents of <file>.">;
46def strip_all : Flag<["-", "--"], "strip-all">,
Alexander Shaposhnikovb3bfd3b2018-04-24 21:44:13 +000047 HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000048def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
49 HelpText<"Compaitable with GNU objcopy's --strip-all">;
50def strip_debug : Flag<["-", "--"], "strip-debug">,
Alexander Shaposhnikovb3bfd3b2018-04-24 21:44:13 +000051 HelpText<"Remove all debug information">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000052def strip_dwo : Flag<["-", "--"], "strip-dwo">,
53 HelpText<"Remove all DWARF .dwo sections from file">;
54def strip_sections : Flag<["-", "--"], "strip-sections">,
55 HelpText<"Remove all section headers">;
56def strip_non_alloc : Flag<["-", "--"], "strip-non-alloc">,
57 HelpText<"Remove all non-allocated sections">;
58def extract_dwo : Flag<["-", "--"], "extract-dwo">,
59 HelpText<"Remove all sections that are not DWARF .dwo sections from file">;
60def localize_hidden : Flag<["-", "--"], "localize-hidden">,
61 HelpText<"Mark all symbols that have hidden or internal visibility as local">;
Paul Semelb4924942018-04-26 17:44:43 +000062defm localize_symbol : Eq<"localize-symbol">,
Alexander Shaposhnikov40e9bdf2018-04-26 18:28:17 +000063 MetaVarName<"symbol">,
64 HelpText<"Mark <symbol> as local">;
Paul Semelb4924942018-04-26 17:44:43 +000065def L : JoinedOrSeparate<["-"], "L">,
66 Alias<localize_symbol>;
Paul Semelee5be792018-04-27 19:09:44 +000067defm globalize_symbol : Eq<"globalize-symbol">,
68 MetaVarName<"symbol">,
69 HelpText<"Mark <symbol> as global">;
Paul Semel3a8a56b2018-04-27 19:16:27 +000070defm weaken_symbol : Eq<"weaken-symbol">,
71 MetaVarName<"symbol">,
72 HelpText<"Mark <symbol> as weak">;
73def W : JoinedOrSeparate<["-"], "W">,
74 Alias<weaken_symbol>;