[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / tools / llvm-objcopy / ObjcopyOpts.td
blobbfd66caf41ed00053d6f7bd020f020f2aff8078f
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">,
10               Values<"binary">;
11 def F : JoinedOrSeparate<["-"], "F">,
12         Alias<target>,
13         HelpText<"Alias for --target">;
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">;
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">;
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 : 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">;
45 defm add_gnu_debuglink
46     : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
47       MetaVarName<"debug-file">;
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, exclude, debug, code, data, rom, share, contents, merge, "
54          "strings.">,
55       MetaVarName<"old=new[,flag1,...]">;
56 defm redefine_symbol
57     : Eq<"redefine-sym", "Change the name of a symbol old to new">,
58       MetaVarName<"old=new">;
59 defm redefine_symbols
60     : Eq<"redefine-syms",
61          "Reads a list of symbol pairs from <filename> and runs as if "
62          "--redefine-sym=<old>=<new> is set for each one. <filename> "
63          "contains two symbols per line separated with whitespace and may "
64          "contain comments beginning with '#'. Leading and trailing "
65          "whitespace is stripped from each line. May be repeated to read "
66          "symbols from many files.">,         
67       MetaVarName<"filename">;
69 defm only_section : Eq<"only-section", "Remove all but <section>">,
70                     MetaVarName<"section">;
71 def j : JoinedOrSeparate<["-"], "j">,
72         Alias<only_section>,
73         HelpText<"Alias for --only-section">;
74 defm add_section
75     : Eq<"add-section",
76          "Make a section named <section> with the contents of <file>.">,
77       MetaVarName<"section=file">;
79 defm set_section_alignment
80     : Eq<"set-section-alignment", "Set alignment for a given section.">,
81       MetaVarName<"section=align">;
83 defm set_section_flags
84     : Eq<"set-section-flags",
85          "Set section flags for a given section. Flags supported for GNU "
86          "compatibility: alloc, load, noload, readonly, exclude, debug, code, "
87          "data, rom, share, contents, merge, strings.">,
88       MetaVarName<"section=flag1[,flag2,...]">;
90 def S : Flag<["-"], "S">,
91         Alias<strip_all>,
92         HelpText<"Alias for --strip-all">;
93 def strip_dwo : Flag<["--"], "strip-dwo">,
94                 HelpText<"Remove all DWARF .dwo sections from file">;
95 def strip_non_alloc
96     : Flag<["--"], "strip-non-alloc">,
97       HelpText<"Remove all non-allocated sections outside segments">;
98 defm strip_unneeded_symbol
99     : Eq<"strip-unneeded-symbol",
100          "Remove symbol <symbol> if it is not needed by relocations">,
101       MetaVarName<"symbol">;
102 defm strip_unneeded_symbols
103     : Eq<"strip-unneeded-symbols",
104          "Reads a list of symbols from <filename> and removes them "
105          "if they are not needed by relocations">,
106       MetaVarName<"filename">;
108 defm subsystem
109     : Eq<"subsystem",
110          "Set PE subsystem and version">,
111       MetaVarName<"name[:version]">;
113 def extract_dwo
114     : Flag<["--"], "extract-dwo">,
115       HelpText<
116           "Remove all sections that are not DWARF .dwo sections from file">;
118 defm extract_partition
119     : Eq<"extract-partition", "Extract named partition from input file">,
120       MetaVarName<"name">;
121 def extract_main_partition
122     : Flag<["--"], "extract-main-partition">,
123       HelpText<"Extract main partition from the input file">;
125 def localize_hidden
126     : Flag<["--"], "localize-hidden">,
127       HelpText<
128           "Mark all symbols that have hidden or internal visibility as local">;
129 defm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
130                        MetaVarName<"symbol">;
131 defm localize_symbols
132     : Eq<"localize-symbols",
133          "Reads a list of symbols from <filename> and marks them local.">,
134       MetaVarName<"filename">;
136 def L : JoinedOrSeparate<["-"], "L">,
137         Alias<localize_symbol>,
138         HelpText<"Alias for --localize-symbol">;
140 defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
141                         MetaVarName<"symbol">;
143 defm globalize_symbols
144     : Eq<"globalize-symbols",
145          "Reads a list of symbols from <filename> and marks them global.">,
146       MetaVarName<"filename">;
148 defm keep_global_symbol
149     : Eq<"keep-global-symbol",
150          "Convert all symbols except <symbol> to local. May be repeated to "
151          "convert all except a set of symbols to local.">,
152       MetaVarName<"symbol">;
153 def G : JoinedOrSeparate<["-"], "G">,
154         Alias<keep_global_symbol>,
155         HelpText<"Alias for --keep-global-symbol">;
157 defm keep_global_symbols
158     : Eq<"keep-global-symbols",
159          "Reads a list of symbols from <filename> and runs as if "
160          "--keep-global-symbol=<symbol> is set for each one. <filename> "
161          "contains one symbol per line and may contain comments beginning with "
162          "'#'. Leading and trailing whitespace is stripped from each line. May "
163          "be repeated to read symbols from many files.">,
164       MetaVarName<"filename">;
166 defm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">,
167                      MetaVarName<"symbol">;
168 defm weaken_symbols
169     : Eq<"weaken-symbols",
170          "Reads a list of symbols from <filename> and marks them weak.">,
171       MetaVarName<"filename">;
173 def W : JoinedOrSeparate<["-"], "W">,
174         Alias<weaken_symbol>,
175         HelpText<"Alias for --weaken-symbol">;
176 def weaken : Flag<["--"], "weaken">,
177              HelpText<"Mark all global symbols as weak">;
179 defm strip_symbols
180     : Eq<"strip-symbols",
181          "Reads a list of symbols from <filename> and removes them.">,
182       MetaVarName<"filename">;
184 defm keep_symbols
185     : Eq<"keep-symbols",
186          "Reads a list of symbols from <filename> and runs as if "
187          "--keep-symbol=<symbol> is set for each one. <filename> "
188          "contains one symbol per line and may contain comments beginning with "
189          "'#'. Leading and trailing whitespace is stripped from each line. May "
190          "be repeated to read symbols from many files.">,
191       MetaVarName<"filename">;
193 defm dump_section
194     : Eq<"dump-section",
195          "Dump contents of section named <section> into file <file>">,
196       MetaVarName<"section=file">;
197 defm prefix_symbols
198     : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
199       MetaVarName<"prefix">;
201 defm prefix_alloc_sections
202     : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
203       MetaVarName<"prefix">;
205 defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
206                     "any previous --change-start or --adjust-start values.">,
207                  MetaVarName<"addr">;
208 defm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "                        
209                        "specified multiple times, all values will be applied "
210                        "cumulatively.">,
211                     MetaVarName<"incr">;
212 def adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
213                    Alias<change_start>,
214                    HelpText<"Alias for --change-start">;
216 defm add_symbol
217     : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
218          "global, local, weak, default, hidden, protected, file, section, object, "
219          "function, indirect-function. Accepted but ignored for "
220          "compatibility: debug, constructor, warning, indirect, synthetic, "
221          "unique-object, before.">,
222       MetaVarName<"name=[section:]value[,flags]">;
224 defm update_section
225     : Eq<"update-section", "Add section <name> with contents from a file <file>.">,
226       MetaVarName<"name=file">;