blob: fa98e27e9321b41a244b6e5ec5a14ef70dad7b9e [file] [log] [blame]
Alexander Shaposhnikov409ea282018-05-07 19:32:09 +00001include "llvm/Option/OptParser.td"
2
Fangrui Songd919ed92018-11-01 17:20:40 +00003multiclass Eq<string name, string help> {
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +00004 def NAME : Separate<["--", "-"], name>;
5 def NAME #_eq : Joined<["--", "-"], name #"=">,
6 Alias<!cast<Separate>(NAME)>,
7 HelpText<help>;
Alexander Shaposhnikov409ea282018-05-07 19:32:09 +00008}
9
10def help : Flag<["-", "--"], "help">;
11
Jordan Rupprecht167fb182018-11-01 17:36:37 +000012def enable_deterministic_archives
13 : Flag<["-", "--"], "enable-deterministic-archives">,
14 HelpText<"Enable deterministic mode when stripping archives (use zero "
15 "for UIDs, GIDs, and timestamps).">;
16def D : Flag<["-"], "D">,
17 Alias<enable_deterministic_archives>,
18 HelpText<"Alias for --enable-deterministic-archives">;
19
20def disable_deterministic_archives
21 : Flag<["-", "--"], "disable-deterministic-archives">,
22 HelpText<"Disable deterministic mode when stripping archives (use real "
23 "values for UIDs, GIDs, and timestamps).">;
24def U : Flag<["-"], "U">,
25 Alias<disable_deterministic_archives>,
26 HelpText<"Alias for --disable-deterministic-archives">;
27
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000028defm output : Eq<"o", "Write output to <file>">, MetaVarName<"output">;
Alexander Shaposhnikov9eb93072018-05-31 20:42:13 +000029
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000030def preserve_dates : Flag<["-", "--"], "preserve-dates">,
Jordan Rupprecht7b455c42018-08-16 18:29:40 +000031 HelpText<"Preserve access and modification timestamps">;
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000032def p : Flag<["-"], "p">, Alias<preserve_dates>;
Jordan Rupprecht7b455c42018-08-16 18:29:40 +000033
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000034def strip_all
35 : Flag<["-", "--"], "strip-all">,
36 HelpText<
37 "Remove non-allocated sections other than .gnu.warning* sections">;
38def s : Flag<["-"], "s">, Alias<strip_all>;
Jordan Rupprecht863ec6da2018-10-23 18:46:33 +000039
Jordan Rupprecht9a78ad02018-11-01 17:48:46 +000040def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">,
41 HelpText<"Compatible with GNU strip's --strip-all">;
Alexander Shaposhnikov409ea282018-05-07 19:32:09 +000042def strip_debug : Flag<["-", "--"], "strip-debug">,
43 HelpText<"Remove debugging symbols only">;
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000044def d : Flag<["-"], "d">, Alias<strip_debug>;
45def g : Flag<["-"], "g">, Alias<strip_debug>;
46def S : Flag<["-"], "S">, Alias<strip_debug>;
47def strip_unneeded : Flag<["-", "--"], "strip-unneeded">,
48 HelpText<"Remove all symbols not needed by relocations">;
Alexander Shaposhnikov711621f2018-06-04 18:55:41 +000049
Fangrui Songd919ed92018-11-01 17:20:40 +000050defm remove_section : Eq<"remove-section", "Remove <section>">,
51 MetaVarName<"section">;
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000052def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>;
Alexander Shaposhnikov49011d22018-05-23 19:44:19 +000053
Jordan Rupprecht65bac062018-11-13 19:32:27 +000054defm keep_section : Eq<"keep-section", "Keep <section>">,
55 MetaVarName<"section">;
Fangrui Songd919ed92018-11-01 17:20:40 +000056defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">,
57 MetaVarName<"symbol">;
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000058def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>;
Alexander Shaposhnikov49011d22018-05-23 19:44:19 +000059
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000060def discard_all
61 : Flag<["-", "--"], "discard-all">,
62 HelpText<"Remove all local symbols except file and section symbols">;
63def x : Flag<["-"], "x">, Alias<discard_all>;
Alexander Shaposhnikovad593b02018-06-06 21:23:19 +000064
Jordan Rupprecht78ba7a62018-11-01 21:38:14 +000065def version : Flag<["-", "--"], "version">,
Jordan Rupprecht5b1329d2018-09-21 00:47:31 +000066 HelpText<"Print the version and exit.">;
Martin Storsjo3eeed742018-11-28 06:51:50 +000067def V : Flag<["-"], "V">, Alias<version>;