annotate llvm/tools/llvm-objcopy/ObjcopyOpts.td @ 201:a96fbbdf2d0f

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