1 include "CommonOpts.td"
3 defm binary_architecture
4 : Eq<"binary-architecture", "Used when transforming an architecture-less "
5 "format (such as binary) to another format">;
6 def B : JoinedOrSeparate<["-"], "B">,
7 Alias<binary_architecture>,
8 HelpText<"Alias for --binary-architecture">;
10 defm target : Eq<"target", "Format of the input and output file">,
12 def F : JoinedOrSeparate<["-"], "F">,
14 HelpText<"Alias for --target">;
16 defm input_target : Eq<"input-target", "Format of the input file">,
18 def I : JoinedOrSeparate<["-"], "I">,
20 HelpText<"Alias for --input-target">;
22 defm output_target : Eq<"output-target", "Format of the output file">,
24 def O : JoinedOrSeparate<["-"], "O">,
26 HelpText<"Alias for --output-target">;
28 def compress_debug_sections : Flag<["--"], "compress-debug-sections">;
29 def compress_debug_sections_eq
30 : Joined<["--"], "compress-debug-sections=">,
31 MetaVarName<"[ zlib | zlib-gnu ]">,
32 HelpText<"Compress DWARF debug sections using specified style. Supported "
33 "styles: 'zlib-gnu' and 'zlib'">;
34 def decompress_debug_sections : Flag<["--"], "decompress-debug-sections">,
35 HelpText<"Decompress DWARF debug sections.">;
37 : Eq<"split-dwo", "Equivalent to extract-dwo on the input file to "
38 "<dwo-file>, then strip-dwo on the input file">,
39 MetaVarName<"dwo-file">;
41 defm add_gnu_debuglink
42 : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
43 MetaVarName<"debug-file">;
46 : Eq<"rename-section",
47 "Renames a section from old to new, optionally with specified flags. "
48 "Flags supported for GNU compatibility: alloc, load, noload, "
49 "readonly, debug, code, data, rom, share, contents, merge, strings.">,
50 MetaVarName<"old=new[,flag1,...]">;
52 : Eq<"redefine-sym", "Change the name of a symbol old to new">,
53 MetaVarName<"old=new">;
56 "Reads a list of symbol pairs from <filename> and runs as if "
57 "--redefine-sym=<old>=<new> is set for each one. <filename> "
58 "contains two symbols per line separated with whitespace and may "
59 "contain comments beginning with '#'. Leading and trailing "
60 "whitespace is stripped from each line. May be repeated to read "
61 "symbols from many files.">,
62 MetaVarName<"filename">;
64 defm only_section : Eq<"only-section", "Remove all but <section>">,
65 MetaVarName<"section">;
66 def j : JoinedOrSeparate<["-"], "j">,
68 HelpText<"Alias for --only-section">;
71 "Make a section named <section> with the contents of <file>.">,
72 MetaVarName<"section=file">;
74 defm set_section_flags
75 : Eq<"set-section-flags",
76 "Set section flags for a given section. Flags supported for GNU "
77 "compatibility: alloc, load, noload, readonly, debug, code, data, "
78 "rom, share, contents, merge, strings.">,
79 MetaVarName<"section=flag1[,flag2,...]">;
81 def S : Flag<["-"], "S">,
83 HelpText<"Alias for --strip-all">;
84 def strip_dwo : Flag<["--"], "strip-dwo">,
85 HelpText<"Remove all DWARF .dwo sections from file">;
87 : Flag<["--"], "strip-non-alloc">,
88 HelpText<"Remove all non-allocated sections outside segments">;
89 defm strip_unneeded_symbol
90 : Eq<"strip-unneeded-symbol",
91 "Remove symbol <symbol> if it is not needed by relocations">,
92 MetaVarName<"symbol">;
93 defm strip_unneeded_symbols
94 : Eq<"strip-unneeded-symbols",
95 "Reads a list of symbols from <filename> and removes them "
96 "if they are not needed by relocations">,
97 MetaVarName<"filename">;
100 : Flag<["--"], "extract-dwo">,
102 "Remove all sections that are not DWARF .dwo sections from file">;
104 defm extract_partition
105 : Eq<"extract-partition", "Extract named partition from input file">,
107 def extract_main_partition
108 : Flag<["--"], "extract-main-partition">,
109 HelpText<"Extract main partition from the input file">;
112 : Flag<["--"], "localize-hidden">,
114 "Mark all symbols that have hidden or internal visibility as local">;
115 defm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
116 MetaVarName<"symbol">;
117 defm localize_symbols
118 : Eq<"localize-symbols",
119 "Reads a list of symbols from <filename> and marks them local.">,
120 MetaVarName<"filename">;
122 def L : JoinedOrSeparate<["-"], "L">,
123 Alias<localize_symbol>,
124 HelpText<"Alias for --localize-symbol">;
126 defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
127 MetaVarName<"symbol">;
129 defm globalize_symbols
130 : Eq<"globalize-symbols",
131 "Reads a list of symbols from <filename> and marks them global.">,
132 MetaVarName<"filename">;
134 defm keep_global_symbol
135 : Eq<"keep-global-symbol",
136 "Convert all symbols except <symbol> to local. May be repeated to "
137 "convert all except a set of symbols to local.">,
138 MetaVarName<"symbol">;
139 def G : JoinedOrSeparate<["-"], "G">,
140 Alias<keep_global_symbol>,
141 HelpText<"Alias for --keep-global-symbol">;
143 defm keep_global_symbols
144 : Eq<"keep-global-symbols",
145 "Reads a list of symbols from <filename> and runs as if "
146 "--keep-global-symbol=<symbol> is set for each one. <filename> "
147 "contains one symbol per line and may contain comments beginning with "
148 "'#'. Leading and trailing whitespace is stripped from each line. May "
149 "be repeated to read symbols from many files.">,
150 MetaVarName<"filename">;
152 defm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">,
153 MetaVarName<"symbol">;
155 : Eq<"weaken-symbols",
156 "Reads a list of symbols from <filename> and marks them weak.">,
157 MetaVarName<"filename">;
159 def W : JoinedOrSeparate<["-"], "W">,
160 Alias<weaken_symbol>,
161 HelpText<"Alias for --weaken-symbol">;
162 def weaken : Flag<["--"], "weaken">,
163 HelpText<"Mark all global symbols as weak">;
166 : Eq<"strip-symbols",
167 "Reads a list of symbols from <filename> and removes them.">,
168 MetaVarName<"filename">;
172 "Reads a list of symbols from <filename> and runs as if "
173 "--keep-symbol=<symbol> is set for each one. <filename> "
174 "contains one symbol per line and may contain comments beginning with "
175 "'#'. Leading and trailing whitespace is stripped from each line. May "
176 "be repeated to read symbols from many files.">,
177 MetaVarName<"filename">;
181 "Dump contents of section named <section> into file <file>">,
182 MetaVarName<"section=file">;
184 : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
185 MetaVarName<"prefix">;
187 defm prefix_alloc_sections
188 : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
189 MetaVarName<"prefix">;
191 defm build_id_link_dir
192 : Eq<"build-id-link-dir", "Set directory for --build-id-link-input and "
193 "--build-id-link-output to <dir>">,
195 defm build_id_link_input
196 : Eq<"build-id-link-input", "Hard-link the input to <dir>/xx/xxx<suffix> "
197 "name derived from hex build ID">,
198 MetaVarName<"suffix">;
199 defm build_id_link_output
200 : Eq<"build-id-link-output", "Hard-link the output to <dir>/xx/xxx<suffix> "
201 "name derived from hex build ID">,
202 MetaVarName<"suffix">;
204 defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
205 "any previous --change-start or --adjust-start values.">,
207 defm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "
208 "specified multiple times, all values will be applied "
211 def adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
213 HelpText<"Alias for --change-start">;
216 : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
217 "global, local, weak, default, hidden, protected, file, section, object, "
218 "function, indirect-function. Accepted but ignored for "
219 "compatibility: debug, constructor, warning, indirect, synthetic, "
220 "unique-object, before.">,
221 MetaVarName<"name=[section:]value[,flags]">;