]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/tools/llvm-objcopy/StripOpts.td
MFC r356004:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / tools / llvm-objcopy / StripOpts.td
1 include "llvm/Option/OptParser.td"
2
3 multiclass Eq<string name, string help> {
4   def NAME : Separate<["--"], name>;
5   def NAME #_eq : Joined<["--"], name #"=">,
6                   Alias<!cast<Separate>(NAME)>,
7                   HelpText<help>;
8 }
9
10 def help : Flag<["--"], "help">;
11 def h : Flag<["-"], "h">, Alias<help>;
12
13 def allow_broken_links
14     : Flag<["--"], "allow-broken-links">,
15       HelpText<"Allow llvm-strip to remove sections even if it would leave "
16                "invalid section references. The appropriate sh_link fields "
17                "will be set to zero.">;
18
19 def enable_deterministic_archives
20     : Flag<["--"], "enable-deterministic-archives">,
21       HelpText<"Enable deterministic mode when stripping archives (use zero "
22                "for UIDs, GIDs, and timestamps).">;
23 def D : Flag<["-"], "D">,
24         Alias<enable_deterministic_archives>,
25         HelpText<"Alias for --enable-deterministic-archives">;
26
27 def disable_deterministic_archives
28     : Flag<["--"], "disable-deterministic-archives">,
29       HelpText<"Disable deterministic mode when stripping archives (use real "
30                "values for UIDs, GIDs, and timestamps).">;
31 def U : Flag<["-"], "U">,
32         Alias<disable_deterministic_archives>,
33         HelpText<"Alias for --disable-deterministic-archives">;
34
35 def output : JoinedOrSeparate<["-"], "o">, HelpText<"Write output to <file>">;
36
37 def preserve_dates : Flag<["--"], "preserve-dates">,
38                      HelpText<"Preserve access and modification timestamps">;
39 def p : Flag<["-"], "p">, Alias<preserve_dates>;
40
41 def strip_all : Flag<["--"], "strip-all">,
42                 HelpText<"Remove non-allocated sections outside segments. "
43                           ".gnu.warning* and .ARM.attribute sections are not "
44                           "removed">;
45 def s : Flag<["-"], "s">, Alias<strip_all>;
46 def no_strip_all : Flag<["--"], "no-strip-all">,
47                    HelpText<"Disable --strip-all">;
48
49 def strip_all_gnu : Flag<["--"], "strip-all-gnu">,
50                     HelpText<"Compatible with GNU strip's --strip-all">;
51 def strip_debug : Flag<["--"], "strip-debug">,
52                   HelpText<"Remove debugging symbols only">;
53 def d : Flag<["-"], "d">, Alias<strip_debug>;
54 def g : Flag<["-"], "g">, Alias<strip_debug>;
55 def S : Flag<["-"], "S">, Alias<strip_debug>;
56 def strip_unneeded : Flag<["--"], "strip-unneeded">,
57                      HelpText<"Remove all symbols not needed by relocations">;
58
59 defm remove_section : Eq<"remove-section", "Remove <section>">,
60                       MetaVarName<"section">;
61 def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>;
62
63 defm strip_symbol : Eq<"strip-symbol", "Strip <symbol>">,
64                     MetaVarName<"symbol">;
65 def N : JoinedOrSeparate<["-"], "N">, Alias<strip_symbol>;
66
67 defm keep_section : Eq<"keep-section", "Keep <section>">,
68                     MetaVarName<"section">;
69 defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">,
70                    MetaVarName<"symbol">;
71 def keep_file_symbols : Flag<["--"], "keep-file-symbols">,
72                         HelpText<"Do not remove file symbols">;
73
74 def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>;
75
76 def only_keep_debug
77     : Flag<["--"], "only-keep-debug">,
78       HelpText<"Clear sections that would not be stripped by --strip-debug. "
79                "Currently only implemented for COFF.">;
80
81 def discard_locals : Flag<["--"], "discard-locals">,
82                      HelpText<"Remove compiler-generated local symbols, (e.g. "
83                               "symbols starting with .L)">;
84 def X : Flag<["-"], "X">, Alias<discard_locals>;
85
86 def discard_all
87     : Flag<["--"], "discard-all">,
88       HelpText<"Remove all local symbols except file and section symbols">;
89 def x : Flag<["-"], "x">, Alias<discard_all>;
90
91 def regex
92     : Flag<["--"], "regex">,
93       HelpText<"Permit regular expressions in name comparison">;
94
95 def version : Flag<["--"], "version">,
96               HelpText<"Print the version and exit.">;
97 def V : Flag<["-"], "V">, Alias<version>;