xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
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
32972a253aSDimitry Andricdef compress_debug_sections
330b57cec5SDimitry Andric    : Joined<["--"], "compress-debug-sections=">,
34972a253aSDimitry Andric      MetaVarName<"format">,
35972a253aSDimitry Andric      HelpText<"Compress DWARF debug sections using specified format. Supported "
36*bdd1243dSDimitry Andric               "formats: zlib, zstd. Select zlib if <format> is omitted">;
37972a253aSDimitry Andricdef : Flag<["--"], "compress-debug-sections">, Alias<compress_debug_sections>,
38972a253aSDimitry Andric      AliasArgs<["zlib"]>;
390b57cec5SDimitry Andricdef decompress_debug_sections : Flag<["--"], "decompress-debug-sections">,
400b57cec5SDimitry Andric                                HelpText<"Decompress DWARF debug sections.">;
410b57cec5SDimitry Andricdefm split_dwo
420b57cec5SDimitry Andric    : Eq<"split-dwo", "Equivalent to extract-dwo on the input file to "
430b57cec5SDimitry Andric                      "<dwo-file>, then strip-dwo on the input file">,
440b57cec5SDimitry Andric      MetaVarName<"dwo-file">;
450b57cec5SDimitry Andric
460b57cec5SDimitry Andricdefm add_gnu_debuglink
470b57cec5SDimitry Andric    : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
480b57cec5SDimitry Andric      MetaVarName<"debug-file">;
490b57cec5SDimitry Andric
500b57cec5SDimitry Andricdefm rename_section
510b57cec5SDimitry Andric    : Eq<"rename-section",
520b57cec5SDimitry Andric         "Renames a section from old to new, optionally with specified flags. "
530b57cec5SDimitry Andric         "Flags supported for GNU compatibility: alloc, load, noload, "
54349cc55cSDimitry Andric         "readonly, exclude, debug, code, data, rom, share, contents, merge, "
55349cc55cSDimitry Andric         "strings.">,
560b57cec5SDimitry Andric      MetaVarName<"old=new[,flag1,...]">;
570b57cec5SDimitry Andricdefm redefine_symbol
580b57cec5SDimitry Andric    : Eq<"redefine-sym", "Change the name of a symbol old to new">,
590b57cec5SDimitry Andric      MetaVarName<"old=new">;
600b57cec5SDimitry Andricdefm redefine_symbols
610b57cec5SDimitry Andric    : Eq<"redefine-syms",
620b57cec5SDimitry Andric         "Reads a list of symbol pairs from <filename> and runs as if "
630b57cec5SDimitry Andric         "--redefine-sym=<old>=<new> is set for each one. <filename> "
640b57cec5SDimitry Andric         "contains two symbols per line separated with whitespace and may "
650b57cec5SDimitry Andric         "contain comments beginning with '#'. Leading and trailing "
660b57cec5SDimitry Andric         "whitespace is stripped from each line. May be repeated to read "
670b57cec5SDimitry Andric         "symbols from many files.">,
680b57cec5SDimitry Andric      MetaVarName<"filename">;
690b57cec5SDimitry Andric
700b57cec5SDimitry Andricdefm only_section : Eq<"only-section", "Remove all but <section>">,
710b57cec5SDimitry Andric                    MetaVarName<"section">;
728bcb0991SDimitry Andricdef j : JoinedOrSeparate<["-"], "j">,
738bcb0991SDimitry Andric        Alias<only_section>,
748bcb0991SDimitry Andric        HelpText<"Alias for --only-section">;
750b57cec5SDimitry Andricdefm add_section
760b57cec5SDimitry Andric    : Eq<"add-section",
770b57cec5SDimitry Andric         "Make a section named <section> with the contents of <file>.">,
780b57cec5SDimitry Andric      MetaVarName<"section=file">;
790b57cec5SDimitry Andric
808bcb0991SDimitry Andricdefm set_section_alignment
818bcb0991SDimitry Andric    : Eq<"set-section-alignment", "Set alignment for a given section.">,
828bcb0991SDimitry Andric      MetaVarName<"section=align">;
838bcb0991SDimitry Andric
840b57cec5SDimitry Andricdefm set_section_flags
850b57cec5SDimitry Andric    : Eq<"set-section-flags",
860b57cec5SDimitry Andric         "Set section flags for a given section. Flags supported for GNU "
87349cc55cSDimitry Andric         "compatibility: alloc, load, noload, readonly, exclude, debug, code, "
88349cc55cSDimitry Andric         "data, rom, share, contents, merge, strings.">,
890b57cec5SDimitry Andric      MetaVarName<"section=flag1[,flag2,...]">;
900b57cec5SDimitry Andric
91753f127fSDimitry Andricdefm set_section_type
92753f127fSDimitry Andric    : Eq<"set-section-type",
93753f127fSDimitry Andric         "Set the type of section <section> to the integer <type>">,
94753f127fSDimitry Andric      MetaVarName<"section=type">;
95753f127fSDimitry Andric
968bcb0991SDimitry Andricdef S : Flag<["-"], "S">,
978bcb0991SDimitry Andric        Alias<strip_all>,
988bcb0991SDimitry Andric        HelpText<"Alias for --strip-all">;
990b57cec5SDimitry Andricdef strip_dwo : Flag<["--"], "strip-dwo">,
1000b57cec5SDimitry Andric                HelpText<"Remove all DWARF .dwo sections from file">;
1010b57cec5SDimitry Andricdef strip_non_alloc
1020b57cec5SDimitry Andric    : Flag<["--"], "strip-non-alloc">,
1030b57cec5SDimitry Andric      HelpText<"Remove all non-allocated sections outside segments">;
1040b57cec5SDimitry Andricdefm strip_unneeded_symbol
1050b57cec5SDimitry Andric    : Eq<"strip-unneeded-symbol",
1060b57cec5SDimitry Andric         "Remove symbol <symbol> if it is not needed by relocations">,
1070b57cec5SDimitry Andric      MetaVarName<"symbol">;
1080b57cec5SDimitry Andricdefm strip_unneeded_symbols
1090b57cec5SDimitry Andric    : Eq<"strip-unneeded-symbols",
1100b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and removes them "
1110b57cec5SDimitry Andric         "if they are not needed by relocations">,
1120b57cec5SDimitry Andric      MetaVarName<"filename">;
1130b57cec5SDimitry Andric
11404eeddc0SDimitry Andricdefm subsystem
11504eeddc0SDimitry Andric    : Eq<"subsystem",
11604eeddc0SDimitry Andric         "Set PE subsystem and version">,
11704eeddc0SDimitry Andric      MetaVarName<"name[:version]">;
11804eeddc0SDimitry Andric
1190b57cec5SDimitry Andricdef extract_dwo
1200b57cec5SDimitry Andric    : Flag<["--"], "extract-dwo">,
1210b57cec5SDimitry Andric      HelpText<
1220b57cec5SDimitry Andric          "Remove all sections that are not DWARF .dwo sections from file">;
1230b57cec5SDimitry Andric
1240b57cec5SDimitry Andricdefm extract_partition
1250b57cec5SDimitry Andric    : Eq<"extract-partition", "Extract named partition from input file">,
1260b57cec5SDimitry Andric      MetaVarName<"name">;
1270b57cec5SDimitry Andricdef extract_main_partition
1280b57cec5SDimitry Andric    : Flag<["--"], "extract-main-partition">,
1290b57cec5SDimitry Andric      HelpText<"Extract main partition from the input file">;
1300b57cec5SDimitry Andric
1310b57cec5SDimitry Andricdef localize_hidden
1320b57cec5SDimitry Andric    : Flag<["--"], "localize-hidden">,
1330b57cec5SDimitry Andric      HelpText<
1340b57cec5SDimitry Andric          "Mark all symbols that have hidden or internal visibility as local">;
1350b57cec5SDimitry Andricdefm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
1360b57cec5SDimitry Andric                       MetaVarName<"symbol">;
1370b57cec5SDimitry Andricdefm localize_symbols
1380b57cec5SDimitry Andric    : Eq<"localize-symbols",
1390b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them local.">,
1400b57cec5SDimitry Andric      MetaVarName<"filename">;
1410b57cec5SDimitry Andric
1428bcb0991SDimitry Andricdef L : JoinedOrSeparate<["-"], "L">,
1438bcb0991SDimitry Andric        Alias<localize_symbol>,
1448bcb0991SDimitry Andric        HelpText<"Alias for --localize-symbol">;
1450b57cec5SDimitry Andric
1460b57cec5SDimitry Andricdefm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
1470b57cec5SDimitry Andric                        MetaVarName<"symbol">;
1480b57cec5SDimitry Andric
1490b57cec5SDimitry Andricdefm globalize_symbols
1500b57cec5SDimitry Andric    : Eq<"globalize-symbols",
1510b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them global.">,
1520b57cec5SDimitry Andric      MetaVarName<"filename">;
1530b57cec5SDimitry Andric
1540b57cec5SDimitry Andricdefm keep_global_symbol
1550b57cec5SDimitry Andric    : Eq<"keep-global-symbol",
1560b57cec5SDimitry Andric         "Convert all symbols except <symbol> to local. May be repeated to "
1570b57cec5SDimitry Andric         "convert all except a set of symbols to local.">,
1580b57cec5SDimitry Andric      MetaVarName<"symbol">;
1598bcb0991SDimitry Andricdef G : JoinedOrSeparate<["-"], "G">,
1608bcb0991SDimitry Andric        Alias<keep_global_symbol>,
1618bcb0991SDimitry Andric        HelpText<"Alias for --keep-global-symbol">;
1620b57cec5SDimitry Andric
1630b57cec5SDimitry Andricdefm keep_global_symbols
1640b57cec5SDimitry Andric    : Eq<"keep-global-symbols",
1650b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and runs as if "
1660b57cec5SDimitry Andric         "--keep-global-symbol=<symbol> is set for each one. <filename> "
1670b57cec5SDimitry Andric         "contains one symbol per line and may contain comments beginning with "
1680b57cec5SDimitry Andric         "'#'. Leading and trailing whitespace is stripped from each line. May "
1690b57cec5SDimitry Andric         "be repeated to read symbols from many files.">,
1700b57cec5SDimitry Andric      MetaVarName<"filename">;
1710b57cec5SDimitry Andric
1720b57cec5SDimitry Andricdefm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">,
1730b57cec5SDimitry Andric                     MetaVarName<"symbol">;
1740b57cec5SDimitry Andricdefm weaken_symbols
1750b57cec5SDimitry Andric    : Eq<"weaken-symbols",
1760b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them weak.">,
1770b57cec5SDimitry Andric      MetaVarName<"filename">;
1780b57cec5SDimitry Andric
1798bcb0991SDimitry Andricdef W : JoinedOrSeparate<["-"], "W">,
1808bcb0991SDimitry Andric        Alias<weaken_symbol>,
1818bcb0991SDimitry Andric        HelpText<"Alias for --weaken-symbol">;
1820b57cec5SDimitry Andricdef weaken : Flag<["--"], "weaken">,
1830b57cec5SDimitry Andric             HelpText<"Mark all global symbols as weak">;
1840b57cec5SDimitry Andric
1850b57cec5SDimitry Andricdefm strip_symbols
1860b57cec5SDimitry Andric    : Eq<"strip-symbols",
1870b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and removes them.">,
1880b57cec5SDimitry Andric      MetaVarName<"filename">;
1890b57cec5SDimitry Andric
1900b57cec5SDimitry Andricdefm keep_symbols
1910b57cec5SDimitry Andric    : Eq<"keep-symbols",
1920b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and runs as if "
1930b57cec5SDimitry Andric         "--keep-symbol=<symbol> is set for each one. <filename> "
1940b57cec5SDimitry Andric         "contains one symbol per line and may contain comments beginning with "
1950b57cec5SDimitry Andric         "'#'. Leading and trailing whitespace is stripped from each line. May "
1960b57cec5SDimitry Andric         "be repeated to read symbols from many files.">,
1970b57cec5SDimitry Andric      MetaVarName<"filename">;
1980b57cec5SDimitry Andric
1990b57cec5SDimitry Andricdefm dump_section
2000b57cec5SDimitry Andric    : Eq<"dump-section",
2010b57cec5SDimitry Andric         "Dump contents of section named <section> into file <file>">,
2020b57cec5SDimitry Andric      MetaVarName<"section=file">;
2030b57cec5SDimitry Andricdefm prefix_symbols
2040b57cec5SDimitry Andric    : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
2050b57cec5SDimitry Andric      MetaVarName<"prefix">;
2060b57cec5SDimitry Andric
2070b57cec5SDimitry Andricdefm prefix_alloc_sections
2080b57cec5SDimitry Andric    : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
2090b57cec5SDimitry Andric      MetaVarName<"prefix">;
2100b57cec5SDimitry Andric
2110b57cec5SDimitry Andricdefm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
2120b57cec5SDimitry Andric                    "any previous --change-start or --adjust-start values.">,
2130b57cec5SDimitry Andric                 MetaVarName<"addr">;
2140b57cec5SDimitry Andricdefm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "
2150b57cec5SDimitry Andric                       "specified multiple times, all values will be applied "
2160b57cec5SDimitry Andric                       "cumulatively.">,
2170b57cec5SDimitry Andric                    MetaVarName<"incr">;
2180b57cec5SDimitry Andricdef adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
2198bcb0991SDimitry Andric                   Alias<change_start>,
2208bcb0991SDimitry Andric                   HelpText<"Alias for --change-start">;
2210b57cec5SDimitry Andric
2220b57cec5SDimitry Andricdefm add_symbol
2230b57cec5SDimitry Andric    : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
2248bcb0991SDimitry Andric         "global, local, weak, default, hidden, protected, file, section, object, "
2250b57cec5SDimitry Andric         "function, indirect-function. Accepted but ignored for "
2260b57cec5SDimitry Andric         "compatibility: debug, constructor, warning, indirect, synthetic, "
2270b57cec5SDimitry Andric         "unique-object, before.">,
2280b57cec5SDimitry Andric      MetaVarName<"name=[section:]value[,flags]">;
229349cc55cSDimitry Andric
230349cc55cSDimitry Andricdefm update_section
23181ad6265SDimitry Andric    : Eq<"update-section", "Replace the contents of section <name> with contents from a file <file>.">,
232349cc55cSDimitry Andric      MetaVarName<"name=file">;
233