blob: 2af2108d98d3a02b7964b70e1bc6ed4adb1d5c53 [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>">;
Jordan Rupprechtdb2036e2018-07-20 19:54:24 +000030defm rename_section : Eq<"rename-section">,
31 MetaVarName<"old=new">,
32 HelpText<"Renames a section from old to new">;
Alexander Shaposhnikov40e9bdf2018-04-26 18:28:17 +000033defm redefine_symbol : Eq<"redefine-sym">,
34 MetaVarName<"old=new">,
35 HelpText<"Change the name of a symbol old to new">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000036def R : JoinedOrSeparate<["-"], "R">,
37 Alias<remove_section>;
38defm keep : Eq<"keep">,
39 MetaVarName<"section">,
40 HelpText<"Keep <section>">;
41defm only_keep : Eq<"only-keep">,
42 MetaVarName<"section">,
43 HelpText<"Remove all but <section>">;
44def j : JoinedOrSeparate<["-"], "j">,
45 Alias<only_keep>;
46defm add_section : Eq<"add-section">,
47 MetaVarName<"section=file">,
48 HelpText<"Make a section named <section> with the contents of <file>.">;
49def strip_all : Flag<["-", "--"], "strip-all">,
Alexander Shaposhnikovb3bfd3b2018-04-24 21:44:13 +000050 HelpText<"Remove non-allocated sections other than .gnu.warning* sections">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000051def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
52 HelpText<"Compaitable with GNU objcopy's --strip-all">;
53def strip_debug : Flag<["-", "--"], "strip-debug">,
Alexander Shaposhnikovb3bfd3b2018-04-24 21:44:13 +000054 HelpText<"Remove all debug information">;
Alexander Shaposhnikovd6884792018-04-24 05:43:32 +000055def strip_dwo : Flag<["-", "--"], "strip-dwo">,
56 HelpText<"Remove all DWARF .dwo sections from file">;
57def strip_sections : Flag<["-", "--"], "strip-sections">,
58 HelpText<"Remove all section headers">;
59def strip_non_alloc : Flag<["-", "--"], "strip-non-alloc">,
60 HelpText<"Remove all non-allocated sections">;
61def extract_dwo : Flag<["-", "--"], "extract-dwo">,
62 HelpText<"Remove all sections that are not DWARF .dwo sections from file">;
63def localize_hidden : Flag<["-", "--"], "localize-hidden">,
64 HelpText<"Mark all symbols that have hidden or internal visibility as local">;
Paul Semelb4924942018-04-26 17:44:43 +000065defm localize_symbol : Eq<"localize-symbol">,
Alexander Shaposhnikov40e9bdf2018-04-26 18:28:17 +000066 MetaVarName<"symbol">,
67 HelpText<"Mark <symbol> as local">;
Paul Semelb4924942018-04-26 17:44:43 +000068def L : JoinedOrSeparate<["-"], "L">,
69 Alias<localize_symbol>;
Paul Semelee5be792018-04-27 19:09:44 +000070defm globalize_symbol : Eq<"globalize-symbol">,
71 MetaVarName<"symbol">,
72 HelpText<"Mark <symbol> as global">;
Paul Semel3a8a56b2018-04-27 19:16:27 +000073defm weaken_symbol : Eq<"weaken-symbol">,
74 MetaVarName<"symbol">,
75 HelpText<"Mark <symbol> as weak">;
76def W : JoinedOrSeparate<["-"], "W">,
77 Alias<weaken_symbol>;
Paul Semel2c0510f2018-05-02 20:14:49 +000078def weaken : Flag<["-", "--"], "weaken">,
79 HelpText<"Mark all global symbols as weak">;
Paul Semel41695f82018-05-02 20:19:22 +000080def discard_all : Flag<["-", "--"], "discard-all">,
81 HelpText<"Remove all local symbols except file and section symbols">;
82def x : Flag<["-"], "x">,
83 Alias<discard_all>;
Paul Semel4246a462018-05-09 21:36:54 +000084defm strip_symbol : Eq<"strip-symbol">,
85 MetaVarName<"symbol">,
86 HelpText<"Remove symbol <symbol>">;
87def N : JoinedOrSeparate<["-"], "N">,
88 Alias<strip_symbol>;
Paul Semel5d97c822018-05-15 14:09:37 +000089defm keep_symbol : Eq<"keep-symbol">,
90 MetaVarName<"symbol">,
91 HelpText<"Do not remove symbol <symbol>">;
92def K : JoinedOrSeparate<["-"], "K">,
93 Alias<keep_symbol>;
Jake Ehrliche40398a2018-05-15 20:53:53 +000094def only_keep_debug : Flag<["-", "--"], "only-keep-debug">,
95 HelpText<"Currently ignored. Only for compaitability with GNU objcopy.">;
Paul Semel99dda0b2018-05-25 11:01:25 +000096def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
97 HelpText<"Remove all symbols not needed by relocations">;
Paul Semelcf51c802018-05-26 08:10:37 +000098def keep_file_symbols : Flag<["-", "--"], "keep-file-symbols">,
99 HelpText<"Do not remove file symbols">;