1 include "CommonOpts.td"
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">;
9 defm target : Eq<"target", "Format of the input and output file">,
11 def F : JoinedOrSeparate<["-"], "F">,
13 HelpText<"Alias for --target">;
15 defm input_target : Eq<"input-target", "Format of the input file">,
17 def I : JoinedOrSeparate<["-"], "I">,
19 HelpText<"Alias for --input-target">;
21 defm output_target : Eq<"output-target", "Format of the output file">,
23 def O : JoinedOrSeparate<["-"], "O">,
25 HelpText<"Alias for --output-target">;
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'">;
32 def compress_debug_sections
33 : Joined<["--"], "compress-debug-sections=">,
34 MetaVarName<"format">,
35 HelpText<"Compress DWARF debug sections using specified format. Supported "
36 "formats: zlib, zstd. Select zlib if <format> is omitted">;
37 def : Flag<["--"], "compress-debug-sections">, Alias<compress_debug_sections>,
39 def decompress_debug_sections : Flag<["--"], "decompress-debug-sections">,
40 HelpText<"Decompress DWARF debug sections">;
42 : Eq<"split-dwo", "Equivalent to extract-dwo on the input file to "
43 "<dwo-file>, then strip-dwo on the input file">,
44 MetaVarName<"dwo-file">;
46 defm add_gnu_debuglink
47 : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
48 MetaVarName<"debug-file">;
51 : Eq<"rename-section",
52 "Renames a section from old to new, optionally with specified flags. "
53 "Flags supported for GNU compatibility: alloc, load, noload, "
54 "readonly, exclude, debug, code, data, rom, share, contents, merge, "
56 MetaVarName<"old=new[,flag1,...]">;
58 : Eq<"redefine-sym", "Change the name of a symbol old to new">,
59 MetaVarName<"old=new">;
62 "Reads a list of symbol pairs from <filename> and runs as if "
63 "--redefine-sym=<old>=<new> is set for each one. <filename> "
64 "contains two symbols per line separated with whitespace and may "
65 "contain comments beginning with '#'. Leading and trailing "
66 "whitespace is stripped from each line. May be repeated to read "
67 "symbols from many files">,
68 MetaVarName<"filename">;
70 defm only_section : Eq<"only-section", "Remove all but <section>">,
71 MetaVarName<"section">;
72 def j : JoinedOrSeparate<["-"], "j">,
74 HelpText<"Alias for --only-section">;
77 "Make a section named <section> with the contents of <file>">,
78 MetaVarName<"section=file">;
80 defm set_section_alignment
81 : Eq<"set-section-alignment", "Set alignment for a given section">,
82 MetaVarName<"section=align">;
84 defm set_section_flags
85 : Eq<"set-section-flags",
86 "Set section flags for a given section. Flags supported for GNU "
87 "compatibility: alloc, load, noload, readonly, exclude, debug, code, "
88 "data, rom, share, contents, merge, strings, large">,
89 MetaVarName<"section=flag1[,flag2,...]">;
92 : Eq<"set-section-type",
93 "Set the type of section <section> to the integer <type>">,
94 MetaVarName<"section=type">;
96 def S : Flag<["-"], "S">,
98 HelpText<"Alias for --strip-all">;
99 def strip_dwo : Flag<["--"], "strip-dwo">,
100 HelpText<"Remove all DWARF .dwo sections from file">;
102 : Flag<["--"], "strip-non-alloc">,
103 HelpText<"Remove all non-allocated sections outside segments">;
104 defm strip_unneeded_symbol
105 : Eq<"strip-unneeded-symbol",
106 "Remove symbol <symbol> if it is not needed by relocations">,
107 MetaVarName<"symbol">;
108 defm strip_unneeded_symbols
109 : Eq<"strip-unneeded-symbols",
110 "Reads a list of symbols from <filename> and removes them "
111 "if they are not needed by relocations">,
112 MetaVarName<"filename">;
116 "Set PE subsystem and version">,
117 MetaVarName<"name[:version]">;
120 : Flag<["--"], "extract-dwo">,
122 "Remove all sections that are not DWARF .dwo sections from file">;
124 defm extract_partition
125 : Eq<"extract-partition", "Extract named partition from input file">,
127 def extract_main_partition
128 : Flag<["--"], "extract-main-partition">,
129 HelpText<"Extract main partition from the input file">;
132 : Flag<["--"], "localize-hidden">,
134 "Mark all symbols that have hidden or internal visibility as local">;
135 defm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
136 MetaVarName<"symbol">;
137 defm localize_symbols
138 : Eq<"localize-symbols",
139 "Reads a list of symbols from <filename> and marks them local">,
140 MetaVarName<"filename">;
142 def L : JoinedOrSeparate<["-"], "L">,
143 Alias<localize_symbol>,
144 HelpText<"Alias for --localize-symbol">;
146 defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
147 MetaVarName<"symbol">;
149 defm globalize_symbols
150 : Eq<"globalize-symbols",
151 "Reads a list of symbols from <filename> and marks them global">,
152 MetaVarName<"filename">;
154 defm keep_global_symbol
155 : Eq<"keep-global-symbol",
156 "Convert all symbols except <symbol> to local. May be repeated to "
157 "convert all except a set of symbols to local">,
158 MetaVarName<"symbol">;
159 def G : JoinedOrSeparate<["-"], "G">,
160 Alias<keep_global_symbol>,
161 HelpText<"Alias for --keep-global-symbol">;
163 defm keep_global_symbols
164 : Eq<"keep-global-symbols",
165 "Reads a list of symbols from <filename> and runs as if "
166 "--keep-global-symbol=<symbol> is set for each one. <filename> "
167 "contains one symbol per line and may contain comments beginning with "
168 "'#'. Leading and trailing whitespace is stripped from each line. May "
169 "be repeated to read symbols from many files">,
170 MetaVarName<"filename">;
172 defm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">,
173 MetaVarName<"symbol">;
175 : Eq<"weaken-symbols",
176 "Reads a list of symbols from <filename> and marks them weak">,
177 MetaVarName<"filename">;
179 def W : JoinedOrSeparate<["-"], "W">,
180 Alias<weaken_symbol>,
181 HelpText<"Alias for --weaken-symbol">;
182 def weaken : Flag<["--"], "weaken">,
183 HelpText<"Mark all global symbols as weak">;
186 : Eq<"strip-symbols",
187 "Reads a list of symbols from <filename> and removes them">,
188 MetaVarName<"filename">;
192 "Reads a list of symbols from <filename> and runs as if "
193 "--keep-symbol=<symbol> is set for each one. <filename> "
194 "contains one symbol per line and may contain comments beginning with "
195 "'#'. Leading and trailing whitespace is stripped from each line. May "
196 "be repeated to read symbols from many files">,
197 MetaVarName<"filename">;
201 "Dump contents of section named <section> into file <file>">,
202 MetaVarName<"section=file">;
204 : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
205 MetaVarName<"prefix">;
207 defm prefix_alloc_sections
208 : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
209 MetaVarName<"prefix">;
211 defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
212 "any previous --change-start or --adjust-start values">,
214 defm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "
215 "specified multiple times, all values will be applied "
218 def adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
220 HelpText<"Alias for --change-start">;
223 : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
224 "global, local, weak, default, hidden, protected, file, section, object, "
225 "function, indirect-function. Accepted but ignored for "
226 "compatibility: debug, constructor, warning, indirect, synthetic, "
227 "unique-object, before">,
228 MetaVarName<"name=[section:]value[,flags]">;
231 : Eq<"update-section", "Replace the contents of section <name> with contents from a file <file>">,
232 MetaVarName<"name=file">;