xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td (revision 8bcb0991864975618c09697b1aca10683346d9f0)
1*8bcb0991SDimitry Andricinclude "CommonOpts.td"
20b57cec5SDimitry Andric
30b57cec5SDimitry Andricdefm binary_architecture
4*8bcb0991SDimitry Andric    : Eq<"binary-architecture", "Ignored for compatibility">;
5*8bcb0991SDimitry Andricdef B : JoinedOrSeparate<["-"], "B">,
6*8bcb0991SDimitry Andric        Alias<binary_architecture>,
7*8bcb0991SDimitry Andric        HelpText<"Alias for --binary-architecture">;
80b57cec5SDimitry Andric
90b57cec5SDimitry Andricdefm target : Eq<"target", "Format of the input and output file">,
100b57cec5SDimitry Andric              Values<"binary">;
11*8bcb0991SDimitry Andricdef F : JoinedOrSeparate<["-"], "F">,
12*8bcb0991SDimitry Andric        Alias<target>,
13*8bcb0991SDimitry Andric        HelpText<"Alias for --target">;
140b57cec5SDimitry Andric
150b57cec5SDimitry Andricdefm input_target : Eq<"input-target", "Format of the input file">,
160b57cec5SDimitry Andric                    Values<"binary">;
17*8bcb0991SDimitry Andricdef I : JoinedOrSeparate<["-"], "I">,
18*8bcb0991SDimitry Andric        Alias<input_target>,
19*8bcb0991SDimitry Andric        HelpText<"Alias for --input-target">;
200b57cec5SDimitry Andric
210b57cec5SDimitry Andricdefm output_target : Eq<"output-target", "Format of the output file">,
220b57cec5SDimitry Andric                     Values<"binary">;
23*8bcb0991SDimitry Andricdef O : JoinedOrSeparate<["-"], "O">,
24*8bcb0991SDimitry Andric        Alias<output_target>,
25*8bcb0991SDimitry Andric        HelpText<"Alias for --output-target">;
26*8bcb0991SDimitry Andric
27*8bcb0991SDimitry Andricdefm new_symbol_visibility : Eq<"new-symbol-visibility", "Visibility of "
28*8bcb0991SDimitry Andric                                "symbols generated for binary input or added"
29*8bcb0991SDimitry Andric                                " with --add-symbol unless otherwise"
30*8bcb0991SDimitry 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=">,
350b57cec5SDimitry Andric      MetaVarName<"[ zlib | zlib-gnu ]">,
360b57cec5SDimitry Andric      HelpText<"Compress DWARF debug sections using specified style. Supported "
370b57cec5SDimitry Andric               "styles: 'zlib-gnu' and '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, "
530b57cec5SDimitry Andric         "readonly, debug, code, data, rom, share, contents, merge, strings.">,
540b57cec5SDimitry Andric      MetaVarName<"old=new[,flag1,...]">;
550b57cec5SDimitry Andricdefm redefine_symbol
560b57cec5SDimitry Andric    : Eq<"redefine-sym", "Change the name of a symbol old to new">,
570b57cec5SDimitry Andric      MetaVarName<"old=new">;
580b57cec5SDimitry Andricdefm redefine_symbols
590b57cec5SDimitry Andric    : Eq<"redefine-syms",
600b57cec5SDimitry Andric         "Reads a list of symbol pairs from <filename> and runs as if "
610b57cec5SDimitry Andric         "--redefine-sym=<old>=<new> is set for each one. <filename> "
620b57cec5SDimitry Andric         "contains two symbols per line separated with whitespace and may "
630b57cec5SDimitry Andric         "contain comments beginning with '#'. Leading and trailing "
640b57cec5SDimitry Andric         "whitespace is stripped from each line. May be repeated to read "
650b57cec5SDimitry Andric         "symbols from many files.">,
660b57cec5SDimitry Andric      MetaVarName<"filename">;
670b57cec5SDimitry Andric
680b57cec5SDimitry Andricdefm only_section : Eq<"only-section", "Remove all but <section>">,
690b57cec5SDimitry Andric                    MetaVarName<"section">;
70*8bcb0991SDimitry Andricdef j : JoinedOrSeparate<["-"], "j">,
71*8bcb0991SDimitry Andric        Alias<only_section>,
72*8bcb0991SDimitry Andric        HelpText<"Alias for --only-section">;
730b57cec5SDimitry Andricdefm add_section
740b57cec5SDimitry Andric    : Eq<"add-section",
750b57cec5SDimitry Andric         "Make a section named <section> with the contents of <file>.">,
760b57cec5SDimitry Andric      MetaVarName<"section=file">;
770b57cec5SDimitry Andric
78*8bcb0991SDimitry Andricdefm set_section_alignment
79*8bcb0991SDimitry Andric    : Eq<"set-section-alignment", "Set alignment for a given section.">,
80*8bcb0991SDimitry Andric      MetaVarName<"section=align">;
81*8bcb0991SDimitry Andric
820b57cec5SDimitry Andricdefm set_section_flags
830b57cec5SDimitry Andric    : Eq<"set-section-flags",
840b57cec5SDimitry Andric         "Set section flags for a given section. Flags supported for GNU "
850b57cec5SDimitry Andric         "compatibility: alloc, load, noload, readonly, debug, code, data, "
860b57cec5SDimitry Andric         "rom, share, contents, merge, strings.">,
870b57cec5SDimitry Andric      MetaVarName<"section=flag1[,flag2,...]">;
880b57cec5SDimitry Andric
89*8bcb0991SDimitry Andricdef S : Flag<["-"], "S">,
90*8bcb0991SDimitry Andric        Alias<strip_all>,
91*8bcb0991SDimitry Andric        HelpText<"Alias for --strip-all">;
920b57cec5SDimitry Andricdef strip_dwo : Flag<["--"], "strip-dwo">,
930b57cec5SDimitry Andric                HelpText<"Remove all DWARF .dwo sections from file">;
940b57cec5SDimitry Andricdef strip_non_alloc
950b57cec5SDimitry Andric    : Flag<["--"], "strip-non-alloc">,
960b57cec5SDimitry Andric      HelpText<"Remove all non-allocated sections outside segments">;
970b57cec5SDimitry Andricdefm strip_unneeded_symbol
980b57cec5SDimitry Andric    : Eq<"strip-unneeded-symbol",
990b57cec5SDimitry Andric         "Remove symbol <symbol> if it is not needed by relocations">,
1000b57cec5SDimitry Andric      MetaVarName<"symbol">;
1010b57cec5SDimitry Andricdefm strip_unneeded_symbols
1020b57cec5SDimitry Andric    : Eq<"strip-unneeded-symbols",
1030b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and removes them "
1040b57cec5SDimitry Andric         "if they are not needed by relocations">,
1050b57cec5SDimitry Andric      MetaVarName<"filename">;
1060b57cec5SDimitry Andric
1070b57cec5SDimitry Andricdef extract_dwo
1080b57cec5SDimitry Andric    : Flag<["--"], "extract-dwo">,
1090b57cec5SDimitry Andric      HelpText<
1100b57cec5SDimitry Andric          "Remove all sections that are not DWARF .dwo sections from file">;
1110b57cec5SDimitry Andric
1120b57cec5SDimitry Andricdefm extract_partition
1130b57cec5SDimitry Andric    : Eq<"extract-partition", "Extract named partition from input file">,
1140b57cec5SDimitry Andric      MetaVarName<"name">;
1150b57cec5SDimitry Andricdef extract_main_partition
1160b57cec5SDimitry Andric    : Flag<["--"], "extract-main-partition">,
1170b57cec5SDimitry Andric      HelpText<"Extract main partition from the input file">;
1180b57cec5SDimitry Andric
1190b57cec5SDimitry Andricdef localize_hidden
1200b57cec5SDimitry Andric    : Flag<["--"], "localize-hidden">,
1210b57cec5SDimitry Andric      HelpText<
1220b57cec5SDimitry Andric          "Mark all symbols that have hidden or internal visibility as local">;
1230b57cec5SDimitry Andricdefm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
1240b57cec5SDimitry Andric                       MetaVarName<"symbol">;
1250b57cec5SDimitry Andricdefm localize_symbols
1260b57cec5SDimitry Andric    : Eq<"localize-symbols",
1270b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them local.">,
1280b57cec5SDimitry Andric      MetaVarName<"filename">;
1290b57cec5SDimitry Andric
130*8bcb0991SDimitry Andricdef L : JoinedOrSeparate<["-"], "L">,
131*8bcb0991SDimitry Andric        Alias<localize_symbol>,
132*8bcb0991SDimitry Andric        HelpText<"Alias for --localize-symbol">;
1330b57cec5SDimitry Andric
1340b57cec5SDimitry Andricdefm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
1350b57cec5SDimitry Andric                        MetaVarName<"symbol">;
1360b57cec5SDimitry Andric
1370b57cec5SDimitry Andricdefm globalize_symbols
1380b57cec5SDimitry Andric    : Eq<"globalize-symbols",
1390b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them global.">,
1400b57cec5SDimitry Andric      MetaVarName<"filename">;
1410b57cec5SDimitry Andric
1420b57cec5SDimitry Andricdefm keep_global_symbol
1430b57cec5SDimitry Andric    : Eq<"keep-global-symbol",
1440b57cec5SDimitry Andric         "Convert all symbols except <symbol> to local. May be repeated to "
1450b57cec5SDimitry Andric         "convert all except a set of symbols to local.">,
1460b57cec5SDimitry Andric      MetaVarName<"symbol">;
147*8bcb0991SDimitry Andricdef G : JoinedOrSeparate<["-"], "G">,
148*8bcb0991SDimitry Andric        Alias<keep_global_symbol>,
149*8bcb0991SDimitry Andric        HelpText<"Alias for --keep-global-symbol">;
1500b57cec5SDimitry Andric
1510b57cec5SDimitry Andricdefm keep_global_symbols
1520b57cec5SDimitry Andric    : Eq<"keep-global-symbols",
1530b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and runs as if "
1540b57cec5SDimitry Andric         "--keep-global-symbol=<symbol> is set for each one. <filename> "
1550b57cec5SDimitry Andric         "contains one symbol per line and may contain comments beginning with "
1560b57cec5SDimitry Andric         "'#'. Leading and trailing whitespace is stripped from each line. May "
1570b57cec5SDimitry Andric         "be repeated to read symbols from many files.">,
1580b57cec5SDimitry Andric      MetaVarName<"filename">;
1590b57cec5SDimitry Andric
1600b57cec5SDimitry Andricdefm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">,
1610b57cec5SDimitry Andric                     MetaVarName<"symbol">;
1620b57cec5SDimitry Andricdefm weaken_symbols
1630b57cec5SDimitry Andric    : Eq<"weaken-symbols",
1640b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and marks them weak.">,
1650b57cec5SDimitry Andric      MetaVarName<"filename">;
1660b57cec5SDimitry Andric
167*8bcb0991SDimitry Andricdef W : JoinedOrSeparate<["-"], "W">,
168*8bcb0991SDimitry Andric        Alias<weaken_symbol>,
169*8bcb0991SDimitry Andric        HelpText<"Alias for --weaken-symbol">;
1700b57cec5SDimitry Andricdef weaken : Flag<["--"], "weaken">,
1710b57cec5SDimitry Andric             HelpText<"Mark all global symbols as weak">;
1720b57cec5SDimitry Andric
1730b57cec5SDimitry Andricdefm strip_symbols
1740b57cec5SDimitry Andric    : Eq<"strip-symbols",
1750b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and removes them.">,
1760b57cec5SDimitry Andric      MetaVarName<"filename">;
1770b57cec5SDimitry Andric
1780b57cec5SDimitry Andricdefm keep_symbols
1790b57cec5SDimitry Andric    : Eq<"keep-symbols",
1800b57cec5SDimitry Andric         "Reads a list of symbols from <filename> and runs as if "
1810b57cec5SDimitry Andric         "--keep-symbol=<symbol> is set for each one. <filename> "
1820b57cec5SDimitry Andric         "contains one symbol per line and may contain comments beginning with "
1830b57cec5SDimitry Andric         "'#'. Leading and trailing whitespace is stripped from each line. May "
1840b57cec5SDimitry Andric         "be repeated to read symbols from many files.">,
1850b57cec5SDimitry Andric      MetaVarName<"filename">;
1860b57cec5SDimitry Andric
1870b57cec5SDimitry Andricdefm dump_section
1880b57cec5SDimitry Andric    : Eq<"dump-section",
1890b57cec5SDimitry Andric         "Dump contents of section named <section> into file <file>">,
1900b57cec5SDimitry Andric      MetaVarName<"section=file">;
1910b57cec5SDimitry Andricdefm prefix_symbols
1920b57cec5SDimitry Andric    : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
1930b57cec5SDimitry Andric      MetaVarName<"prefix">;
1940b57cec5SDimitry Andric
1950b57cec5SDimitry Andricdefm prefix_alloc_sections
1960b57cec5SDimitry Andric    : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
1970b57cec5SDimitry Andric      MetaVarName<"prefix">;
1980b57cec5SDimitry Andric
1990b57cec5SDimitry Andricdefm build_id_link_dir
2000b57cec5SDimitry Andric    : Eq<"build-id-link-dir", "Set directory for --build-id-link-input and "
2010b57cec5SDimitry Andric                              "--build-id-link-output to <dir>">,
2020b57cec5SDimitry Andric      MetaVarName<"dir">;
2030b57cec5SDimitry Andricdefm build_id_link_input
2040b57cec5SDimitry Andric    : Eq<"build-id-link-input", "Hard-link the input to <dir>/xx/xxx<suffix> "
2050b57cec5SDimitry Andric                                "name derived from hex build ID">,
2060b57cec5SDimitry Andric      MetaVarName<"suffix">;
2070b57cec5SDimitry Andricdefm build_id_link_output
2080b57cec5SDimitry Andric    : Eq<"build-id-link-output", "Hard-link the output to <dir>/xx/xxx<suffix> "
2090b57cec5SDimitry Andric                                 "name derived from hex build ID">,
2100b57cec5SDimitry Andric      MetaVarName<"suffix">;
2110b57cec5SDimitry Andric
2120b57cec5SDimitry Andricdefm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
2130b57cec5SDimitry Andric                    "any previous --change-start or --adjust-start values.">,
2140b57cec5SDimitry Andric                 MetaVarName<"addr">;
2150b57cec5SDimitry Andricdefm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "
2160b57cec5SDimitry Andric                       "specified multiple times, all values will be applied "
2170b57cec5SDimitry Andric                       "cumulatively.">,
2180b57cec5SDimitry Andric                    MetaVarName<"incr">;
2190b57cec5SDimitry Andricdef adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
220*8bcb0991SDimitry Andric                   Alias<change_start>,
221*8bcb0991SDimitry Andric                   HelpText<"Alias for --change-start">;
2220b57cec5SDimitry Andric
2230b57cec5SDimitry Andricdefm add_symbol
2240b57cec5SDimitry Andric    : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
225*8bcb0991SDimitry Andric         "global, local, weak, default, hidden, protected, file, section, object, "
2260b57cec5SDimitry Andric         "function, indirect-function. Accepted but ignored for "
2270b57cec5SDimitry Andric         "compatibility: debug, constructor, warning, indirect, synthetic, "
2280b57cec5SDimitry Andric         "unique-object, before.">,
2290b57cec5SDimitry Andric      MetaVarName<"name=[section:]value[,flags]">;
230