]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td
MFV 364468:
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / tools / llvm-objcopy / ObjcopyOpts.td
1 include "CommonOpts.td"
2
3 defm binary_architecture
4     : Eq<"binary-architecture", "Ignored for compatibility">;
5 def B : JoinedOrSeparate<["-"], "B">,
6         Alias<binary_architecture>,
7         HelpText<"Alias for --binary-architecture">;
8
9 defm target : Eq<"target", "Format of the input and output file">,
10               Values<"binary">;
11 def F : JoinedOrSeparate<["-"], "F">,
12         Alias<target>,
13         HelpText<"Alias for --target">;
14
15 defm input_target : Eq<"input-target", "Format of the input file">,
16                     Values<"binary">;
17 def I : JoinedOrSeparate<["-"], "I">,
18         Alias<input_target>,
19         HelpText<"Alias for --input-target">;
20
21 defm output_target : Eq<"output-target", "Format of the output file">,
22                      Values<"binary">;
23 def O : JoinedOrSeparate<["-"], "O">,
24         Alias<output_target>,
25         HelpText<"Alias for --output-target">;
26
27 defm new_symbol_visibility : Eq<"new-symbol-visibility", "Visibility of "
28                                 "symbols generated for binary input or added"
29                                 " with --add-symbol unless otherwise"
30                                 " specified. The default value is 'default'.">;
31
32 def compress_debug_sections : Flag<["--"], "compress-debug-sections">;
33 def compress_debug_sections_eq
34     : Joined<["--"], "compress-debug-sections=">,
35       MetaVarName<"[ zlib | zlib-gnu ]">,
36       HelpText<"Compress DWARF debug sections using specified style. Supported "
37                "styles: 'zlib-gnu' and 'zlib'">;
38 def decompress_debug_sections : Flag<["--"], "decompress-debug-sections">,
39                                 HelpText<"Decompress DWARF debug sections.">;
40 defm split_dwo
41     : Eq<"split-dwo", "Equivalent to extract-dwo on the input file to "
42                       "<dwo-file>, then strip-dwo on the input file">,
43       MetaVarName<"dwo-file">;
44
45 defm add_gnu_debuglink
46     : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
47       MetaVarName<"debug-file">;
48
49 defm rename_section
50     : Eq<"rename-section",
51          "Renames a section from old to new, optionally with specified flags. "
52          "Flags supported for GNU compatibility: alloc, load, noload, "
53          "readonly, debug, code, data, rom, share, contents, merge, strings.">,
54       MetaVarName<"old=new[,flag1,...]">;
55 defm redefine_symbol
56     : Eq<"redefine-sym", "Change the name of a symbol old to new">,
57       MetaVarName<"old=new">;
58 defm redefine_symbols
59     : Eq<"redefine-syms",
60          "Reads a list of symbol pairs from <filename> and runs as if "
61          "--redefine-sym=<old>=<new> is set for each one. <filename> "
62          "contains two symbols per line separated with whitespace and may "
63          "contain comments beginning with '#'. Leading and trailing "
64          "whitespace is stripped from each line. May be repeated to read "
65          "symbols from many files.">,         
66       MetaVarName<"filename">;
67
68 defm only_section : Eq<"only-section", "Remove all but <section>">,
69                     MetaVarName<"section">;
70 def j : JoinedOrSeparate<["-"], "j">,
71         Alias<only_section>,
72         HelpText<"Alias for --only-section">;
73 defm add_section
74     : Eq<"add-section",
75          "Make a section named <section> with the contents of <file>.">,
76       MetaVarName<"section=file">;
77
78 defm set_section_alignment
79     : Eq<"set-section-alignment", "Set alignment for a given section.">,
80       MetaVarName<"section=align">;
81
82 defm set_section_flags
83     : Eq<"set-section-flags",
84          "Set section flags for a given section. Flags supported for GNU "
85          "compatibility: alloc, load, noload, readonly, debug, code, data, "
86          "rom, share, contents, merge, strings.">,
87       MetaVarName<"section=flag1[,flag2,...]">;
88
89 def S : Flag<["-"], "S">,
90         Alias<strip_all>,
91         HelpText<"Alias for --strip-all">;
92 def strip_dwo : Flag<["--"], "strip-dwo">,
93                 HelpText<"Remove all DWARF .dwo sections from file">;
94 def strip_non_alloc
95     : Flag<["--"], "strip-non-alloc">,
96       HelpText<"Remove all non-allocated sections outside segments">;
97 defm strip_unneeded_symbol
98     : Eq<"strip-unneeded-symbol",
99          "Remove symbol <symbol> if it is not needed by relocations">,
100       MetaVarName<"symbol">;
101 defm strip_unneeded_symbols
102     : Eq<"strip-unneeded-symbols",
103          "Reads a list of symbols from <filename> and removes them "
104          "if they are not needed by relocations">,
105       MetaVarName<"filename">;
106
107 def extract_dwo
108     : Flag<["--"], "extract-dwo">,
109       HelpText<
110           "Remove all sections that are not DWARF .dwo sections from file">;
111
112 defm extract_partition
113     : Eq<"extract-partition", "Extract named partition from input file">,
114       MetaVarName<"name">;
115 def extract_main_partition
116     : Flag<["--"], "extract-main-partition">,
117       HelpText<"Extract main partition from the input file">;
118
119 def localize_hidden
120     : Flag<["--"], "localize-hidden">,
121       HelpText<
122           "Mark all symbols that have hidden or internal visibility as local">;
123 defm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
124                        MetaVarName<"symbol">;
125 defm localize_symbols
126     : Eq<"localize-symbols",
127          "Reads a list of symbols from <filename> and marks them local.">,
128       MetaVarName<"filename">;
129
130 def L : JoinedOrSeparate<["-"], "L">,
131         Alias<localize_symbol>,
132         HelpText<"Alias for --localize-symbol">;
133
134 defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
135                         MetaVarName<"symbol">;
136
137 defm globalize_symbols
138     : Eq<"globalize-symbols",
139          "Reads a list of symbols from <filename> and marks them global.">,
140       MetaVarName<"filename">;
141
142 defm keep_global_symbol
143     : Eq<"keep-global-symbol",
144          "Convert all symbols except <symbol> to local. May be repeated to "
145          "convert all except a set of symbols to local.">,
146       MetaVarName<"symbol">;
147 def G : JoinedOrSeparate<["-"], "G">,
148         Alias<keep_global_symbol>,
149         HelpText<"Alias for --keep-global-symbol">;
150
151 defm keep_global_symbols
152     : Eq<"keep-global-symbols",
153          "Reads a list of symbols from <filename> and runs as if "
154          "--keep-global-symbol=<symbol> is set for each one. <filename> "
155          "contains one symbol per line and may contain comments beginning with "
156          "'#'. Leading and trailing whitespace is stripped from each line. May "
157          "be repeated to read symbols from many files.">,
158       MetaVarName<"filename">;
159
160 defm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">,
161                      MetaVarName<"symbol">;
162 defm weaken_symbols
163     : Eq<"weaken-symbols",
164          "Reads a list of symbols from <filename> and marks them weak.">,
165       MetaVarName<"filename">;
166
167 def W : JoinedOrSeparate<["-"], "W">,
168         Alias<weaken_symbol>,
169         HelpText<"Alias for --weaken-symbol">;
170 def weaken : Flag<["--"], "weaken">,
171              HelpText<"Mark all global symbols as weak">;
172
173 defm strip_symbols
174     : Eq<"strip-symbols",
175          "Reads a list of symbols from <filename> and removes them.">,
176       MetaVarName<"filename">;
177
178 defm keep_symbols
179     : Eq<"keep-symbols",
180          "Reads a list of symbols from <filename> and runs as if "
181          "--keep-symbol=<symbol> is set for each one. <filename> "
182          "contains one symbol per line and may contain comments beginning with "
183          "'#'. Leading and trailing whitespace is stripped from each line. May "
184          "be repeated to read symbols from many files.">,
185       MetaVarName<"filename">;
186
187 defm dump_section
188     : Eq<"dump-section",
189          "Dump contents of section named <section> into file <file>">,
190       MetaVarName<"section=file">;
191 defm prefix_symbols
192     : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
193       MetaVarName<"prefix">;
194
195 defm prefix_alloc_sections
196     : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
197       MetaVarName<"prefix">;
198
199 defm build_id_link_dir
200     : Eq<"build-id-link-dir", "Set directory for --build-id-link-input and "
201                               "--build-id-link-output to <dir>">,
202       MetaVarName<"dir">;
203 defm build_id_link_input
204     : Eq<"build-id-link-input", "Hard-link the input to <dir>/xx/xxx<suffix> "
205                                 "name derived from hex build ID">,
206       MetaVarName<"suffix">;
207 defm build_id_link_output
208     : Eq<"build-id-link-output", "Hard-link the output to <dir>/xx/xxx<suffix> "
209                                  "name derived from hex build ID">,
210       MetaVarName<"suffix">;
211
212 defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
213                     "any previous --change-start or --adjust-start values.">,
214                  MetaVarName<"addr">;
215 defm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "                        
216                        "specified multiple times, all values will be applied "
217                        "cumulatively.">,
218                     MetaVarName<"incr">;
219 def adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
220                    Alias<change_start>,
221                    HelpText<"Alias for --change-start">;
222
223 defm add_symbol
224     : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
225          "global, local, weak, default, hidden, protected, file, section, object, "
226          "function, indirect-function. Accepted but ignored for "
227          "compatibility: debug, constructor, warning, indirect, synthetic, "
228          "unique-object, before.">,
229       MetaVarName<"name=[section:]value[,flags]">;