xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td (revision 753f127f3ace09432b2baeffd71a308760641a62)
18bcb0991SDimitry Andricinclude "CommonOpts.td"
20b57cec5SDimitry Andric
30b57cec5SDimitry Andricdefm binary_architecture
48bcb0991SDimitry Andric    : Eq<"binary-architecture", "Ignored for compatibility">;
58bcb0991SDimitry Andricdef B : JoinedOrSeparate<["-"], "B">,
68bcb0991SDimitry Andric        Alias<binary_architecture>,
78bcb0991SDimitry Andric        HelpText<"Alias for --binary-architecture">;
80b57cec5SDimitry Andric
90b57cec5SDimitry Andricdefm target : Eq<"target", "Format of the input and output file">,
100b57cec5SDimitry Andric              Values<"binary">;
118bcb0991SDimitry Andricdef F : JoinedOrSeparate<["-"], "F">,
128bcb0991SDimitry Andric        Alias<target>,
138bcb0991SDimitry Andric        HelpText<"Alias for --target">;
140b57cec5SDimitry Andric
150b57cec5SDimitry Andricdefm input_target : Eq<"input-target", "Format of the input file">,
160b57cec5SDimitry Andric                    Values<"binary">;
178bcb0991SDimitry Andricdef I : JoinedOrSeparate<["-"], "I">,
188bcb0991SDimitry Andric        Alias<input_target>,
198bcb0991SDimitry Andric        HelpText<"Alias for --input-target">;
200b57cec5SDimitry Andric
210b57cec5SDimitry Andricdefm output_target : Eq<"output-target", "Format of the output file">,
220b57cec5SDimitry Andric                     Values<"binary">;
238bcb0991SDimitry Andricdef O : JoinedOrSeparate<["-"], "O">,
248bcb0991SDimitry Andric        Alias<output_target>,
258bcb0991SDimitry Andric        HelpText<"Alias for --output-target">;
268bcb0991SDimitry Andric
278bcb0991SDimitry Andricdefm new_symbol_visibility : Eq<"new-symbol-visibility", "Visibility of "
288bcb0991SDimitry Andric                                "symbols generated for binary input or added"
298bcb0991SDimitry Andric                                " with --add-symbol unless otherwise"
308bcb0991SDimitry Andric                                " specified. The default value is 'default'.">;
310b57cec5SDimitry Andric
320b57cec5SDimitry Andricdef compress_debug_sections : Flag<["--"], "compress-debug-sections">;
330b57cec5SDimitry Andricdef compress_debug_sections_eq
340b57cec5SDimitry Andric    : Joined<["--"], "compress-debug-sections=">,
3581ad6265SDimitry Andric      MetaVarName<"[ zlib ]">,
360b57cec5SDimitry Andric      HelpText<"Compress DWARF debug sections using specified style. Supported "
3781ad6265SDimitry Andric               "formats: 'zlib'">;
380b57cec5SDimitry Andricdef decompress_debug_sections : Flag<["--"], "decompress-debug-sections">,
390b57cec5SDimitry Andric                                HelpText<"Decompress DWARF debug sections.">;
400b57cec5SDimitry Andricdefm split_dwo
410b57cec5SDimitry Andric    : Eq<"split-dwo", "Equivalent to extract-dwo on the input file to "
420b57cec5SDimitry Andric                      "<dwo-file>, then strip-dwo on the input file">,
430b57cec5SDimitry Andric      MetaVarName<"dwo-file">;
440b57cec5SDimitry Andric
450b57cec5SDimitry Andricdefm add_gnu_debuglink
460b57cec5SDimitry Andric    : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
470b57cec5SDimitry Andric      MetaVarName<"debug-file">;
480b57cec5SDimitry Andric
490b57cec5SDimitry Andricdefm rename_section
500b57cec5SDimitry Andric    : Eq<"rename-section",
510b57cec5SDimitry Andric         "Renames a section from old to new, optionally with specified flags. "
520b57cec5SDimitry Andric         "Flags supported for GNU compatibility: alloc, load, noload, "
53349cc55cSDimitry Andric         "readonly, exclude, debug, code, data, rom, share, contents, merge, "
54349cc55cSDimitry Andric         "strings.">,
550b57cec5SDimitry Andric      MetaVarName<"old=new[,flag1,...]">;
560b57cec5SDimitry Andricdefm redefine_symbol
570b57cec5SDimitry Andric    : Eq<"redefine-sym", "Change the name of a symbol old to new">,
580b57cec5SDimitry Andric      MetaVarName<"old=new">;
590b57cec5SDimitry Andricdefm redefine_symbols
600b57cec5SDimitry Andric    : Eq<"redefine-syms",
610b57cec5SDimitry Andric         "Reads a list of symbol pairs from <filename> and runs as if "
620b57cec5SDimitry Andric         "--redefine-sym=<old>=<new> is set for each one. <filename> "
630b57cec5SDimitry Andric         "contains two symbols per line separated with whitespace and may "
640b57cec5SDimitry Andric         "contain comments beginning with '#'. Leading and trailing "
650b57cec5SDimitry Andric         "whitespace is stripped from each line. May be repeated to read "
660b57cec5SDimitry Andric         "symbols from many files.">,
670b57cec5SDimitry Andric      MetaVarName<"filename">;
680b57cec5SDimitry Andric
690b57cec5SDimitry Andricdefm only_section : Eq<"only-section", "Remove all but <section>">,
700b57cec5SDimitry Andric                    MetaVarName<"section">;
718bcb0991SDimitry Andricdef j : JoinedOrSeparate<["-"], "j">,
728bcb0991SDimitry Andric        Alias<only_section>,
738bcb0991SDimitry Andric        HelpText<"Alias for --only-section">;
740b57cec5SDimitry Andricdefm add_section
750b57cec5SDimitry Andric    : Eq<"add-section",
760b57cec5SDimitry Andric         "Make a section named <section> with the contents of <file>.">,
770b57cec5SDimitry Andric      MetaVarName<"section=file">;
780b57cec5SDimitry Andric
798bcb0991SDimitry Andricdefm set_section_alignment
808bcb0991SDimitry Andric    : Eq<"set-section-alignment", "Set alignment for a given section.">,
818bcb0991SDimitry Andric      MetaVarName<"section=align">;
828bcb0991SDimitry Andric
830b57cec5SDimitry Andricdefm set_section_flags
840b57cec5SDimitry Andric    : Eq<"set-section-flags",
850b57cec5SDimitry Andric         "Set section flags for a given section. Flags supported for GNU "
86349cc55cSDimitry Andric         "compatibility: alloc, load, noload, readonly, exclude, debug, code, "
87349cc55cSDimitry Andric         "data, rom, share, contents, merge, strings.">,
880b57cec5SDimitry Andric      MetaVarName<"section=flag1[,flag2,...]">;
890b57cec5SDimitry Andric
90*753f127fSDimitry Andricdefm set_section_type
91*753f127fSDimitry Andric    : Eq<"set-section-type",
92*753f127fSDimitry Andric         "Set the type of section <section> to the integer <type>">,
93*753f127fSDimitry Andric      MetaVarName<"section=type">;
94*753f127fSDimitry Andric
958bcb0991SDimitry Andricdef S : Flag<["-"], "S">,
968bcb0991SDimitry Andric        Alias<strip_all>,
978bcb0991SDimitry Andric        HelpText<"Alias for --strip-all">;
980b57cec5SDimitry Andricdef strip_dwo : Flag<["--"], "strip-dwo">,
990b57cec5SDimitry Andric                HelpText<"Remove all DWARF .dwo sections from file">;
1000b57cec5SDimitry Andricdef strip_non_alloc
1010b57cec5SDimitry Andric    : Flag<["--"], "strip-non-alloc">,
1020b57cec5SDimitry Andric      HelpText<"Remove all non-allocated sections outside segments">;
1030b57cec5SDimitry Andricdefm strip_unneeded_symbol
1040b57cec5SDimitry Andric    : Eq<"strip-unneeded-symbol",
1050b57cec5SDimitry Andric         "Remove symbol <symbol> if it is not needed by relocations">,
1060b57cec5SDimitry Andric      MetaVarName<"symbol">;
1070b57cec5SDimitry Andricdefm strip_unneeded_symbols
1080b57cec5SDimitry Andric    : Eq<"strip-unneeded-symbols",
1090b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and removes them "
1100b57cec5SDimitry Andric         "if they are not needed by relocations">,
1110b57cec5SDimitry Andric      MetaVarName<"filename">;
1120b57cec5SDimitry Andric
11304eeddc0SDimitry Andricdefm subsystem
11404eeddc0SDimitry Andric    : Eq<"subsystem",
11504eeddc0SDimitry Andric         "Set PE subsystem and version">,
11604eeddc0SDimitry Andric      MetaVarName<"name[:version]">;
11704eeddc0SDimitry Andric
1180b57cec5SDimitry Andricdef extract_dwo
1190b57cec5SDimitry Andric    : Flag<["--"], "extract-dwo">,
1200b57cec5SDimitry Andric      HelpText<
1210b57cec5SDimitry Andric          "Remove all sections that are not DWARF .dwo sections from file">;
1220b57cec5SDimitry Andric
1230b57cec5SDimitry Andricdefm extract_partition
1240b57cec5SDimitry Andric    : Eq<"extract-partition", "Extract named partition from input file">,
1250b57cec5SDimitry Andric      MetaVarName<"name">;
1260b57cec5SDimitry Andricdef extract_main_partition
1270b57cec5SDimitry Andric    : Flag<["--"], "extract-main-partition">,
1280b57cec5SDimitry Andric      HelpText<"Extract main partition from the input file">;
1290b57cec5SDimitry Andric
1300b57cec5SDimitry Andricdef localize_hidden
1310b57cec5SDimitry Andric    : Flag<["--"], "localize-hidden">,
1320b57cec5SDimitry Andric      HelpText<
1330b57cec5SDimitry Andric          "Mark all symbols that have hidden or internal visibility as local">;
1340b57cec5SDimitry Andricdefm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
1350b57cec5SDimitry Andric                       MetaVarName<"symbol">;
1360b57cec5SDimitry Andricdefm localize_symbols
1370b57cec5SDimitry Andric    : Eq<"localize-symbols",
1380b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them local.">,
1390b57cec5SDimitry Andric      MetaVarName<"filename">;
1400b57cec5SDimitry Andric
1418bcb0991SDimitry Andricdef L : JoinedOrSeparate<["-"], "L">,
1428bcb0991SDimitry Andric        Alias<localize_symbol>,
1438bcb0991SDimitry Andric        HelpText<"Alias for --localize-symbol">;
1440b57cec5SDimitry Andric
1450b57cec5SDimitry Andricdefm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
1460b57cec5SDimitry Andric                        MetaVarName<"symbol">;
1470b57cec5SDimitry Andric
1480b57cec5SDimitry Andricdefm globalize_symbols
1490b57cec5SDimitry Andric    : Eq<"globalize-symbols",
1500b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them global.">,
1510b57cec5SDimitry Andric      MetaVarName<"filename">;
1520b57cec5SDimitry Andric
1530b57cec5SDimitry Andricdefm keep_global_symbol
1540b57cec5SDimitry Andric    : Eq<"keep-global-symbol",
1550b57cec5SDimitry Andric         "Convert all symbols except <symbol> to local. May be repeated to "
1560b57cec5SDimitry Andric         "convert all except a set of symbols to local.">,
1570b57cec5SDimitry Andric      MetaVarName<"symbol">;
1588bcb0991SDimitry Andricdef G : JoinedOrSeparate<["-"], "G">,
1598bcb0991SDimitry Andric        Alias<keep_global_symbol>,
1608bcb0991SDimitry Andric        HelpText<"Alias for --keep-global-symbol">;
1610b57cec5SDimitry Andric
1620b57cec5SDimitry Andricdefm keep_global_symbols
1630b57cec5SDimitry Andric    : Eq<"keep-global-symbols",
1640b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and runs as if "
1650b57cec5SDimitry Andric         "--keep-global-symbol=<symbol> is set for each one. <filename> "
1660b57cec5SDimitry Andric         "contains one symbol per line and may contain comments beginning with "
1670b57cec5SDimitry Andric         "'#'. Leading and trailing whitespace is stripped from each line. May "
1680b57cec5SDimitry Andric         "be repeated to read symbols from many files.">,
1690b57cec5SDimitry Andric      MetaVarName<"filename">;
1700b57cec5SDimitry Andric
1710b57cec5SDimitry Andricdefm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">,
1720b57cec5SDimitry Andric                     MetaVarName<"symbol">;
1730b57cec5SDimitry Andricdefm weaken_symbols
1740b57cec5SDimitry Andric    : Eq<"weaken-symbols",
1750b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them weak.">,
1760b57cec5SDimitry Andric      MetaVarName<"filename">;
1770b57cec5SDimitry Andric
1788bcb0991SDimitry Andricdef W : JoinedOrSeparate<["-"], "W">,
1798bcb0991SDimitry Andric        Alias<weaken_symbol>,
1808bcb0991SDimitry Andric        HelpText<"Alias for --weaken-symbol">;
1810b57cec5SDimitry Andricdef weaken : Flag<["--"], "weaken">,
1820b57cec5SDimitry Andric             HelpText<"Mark all global symbols as weak">;
1830b57cec5SDimitry Andric
1840b57cec5SDimitry Andricdefm strip_symbols
1850b57cec5SDimitry Andric    : Eq<"strip-symbols",
1860b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and removes them.">,
1870b57cec5SDimitry Andric      MetaVarName<"filename">;
1880b57cec5SDimitry Andric
1890b57cec5SDimitry Andricdefm keep_symbols
1900b57cec5SDimitry Andric    : Eq<"keep-symbols",
1910b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and runs as if "
1920b57cec5SDimitry Andric         "--keep-symbol=<symbol> is set for each one. <filename> "
1930b57cec5SDimitry Andric         "contains one symbol per line and may contain comments beginning with "
1940b57cec5SDimitry Andric         "'#'. Leading and trailing whitespace is stripped from each line. May "
1950b57cec5SDimitry Andric         "be repeated to read symbols from many files.">,
1960b57cec5SDimitry Andric      MetaVarName<"filename">;
1970b57cec5SDimitry Andric
1980b57cec5SDimitry Andricdefm dump_section
1990b57cec5SDimitry Andric    : Eq<"dump-section",
2000b57cec5SDimitry Andric         "Dump contents of section named <section> into file <file>">,
2010b57cec5SDimitry Andric      MetaVarName<"section=file">;
2020b57cec5SDimitry Andricdefm prefix_symbols
2030b57cec5SDimitry Andric    : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
2040b57cec5SDimitry Andric      MetaVarName<"prefix">;
2050b57cec5SDimitry Andric
2060b57cec5SDimitry Andricdefm prefix_alloc_sections
2070b57cec5SDimitry Andric    : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
2080b57cec5SDimitry Andric      MetaVarName<"prefix">;
2090b57cec5SDimitry Andric
2100b57cec5SDimitry Andricdefm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
2110b57cec5SDimitry Andric                    "any previous --change-start or --adjust-start values.">,
2120b57cec5SDimitry Andric                 MetaVarName<"addr">;
2130b57cec5SDimitry Andricdefm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "
2140b57cec5SDimitry Andric                       "specified multiple times, all values will be applied "
2150b57cec5SDimitry Andric                       "cumulatively.">,
2160b57cec5SDimitry Andric                    MetaVarName<"incr">;
2170b57cec5SDimitry Andricdef adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
2188bcb0991SDimitry Andric                   Alias<change_start>,
2198bcb0991SDimitry Andric                   HelpText<"Alias for --change-start">;
2200b57cec5SDimitry Andric
2210b57cec5SDimitry Andricdefm add_symbol
2220b57cec5SDimitry Andric    : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
2238bcb0991SDimitry Andric         "global, local, weak, default, hidden, protected, file, section, object, "
2240b57cec5SDimitry Andric         "function, indirect-function. Accepted but ignored for "
2250b57cec5SDimitry Andric         "compatibility: debug, constructor, warning, indirect, synthetic, "
2260b57cec5SDimitry Andric         "unique-object, before.">,
2270b57cec5SDimitry Andric      MetaVarName<"name=[section:]value[,flags]">;
228349cc55cSDimitry Andric
229349cc55cSDimitry Andricdefm update_section
23081ad6265SDimitry Andric    : Eq<"update-section", "Replace the contents of section <name> with contents from a file <file>.">,
231349cc55cSDimitry Andric      MetaVarName<"name=file">;
232