xref: /freebsd/contrib/llvm-project/lld/ELF/Options.td (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
10b57cec5SDimitry Andricinclude "llvm/Option/OptParser.td"
20b57cec5SDimitry Andric
35ffd83dbSDimitry Andric// Convenience classes for long options which only accept two dashes. For lld
45ffd83dbSDimitry Andric// specific or newer long options, we prefer two dashes to avoid collision with
55ffd83dbSDimitry Andric// short options. For many others, we have to accept both forms to be compatible
65ffd83dbSDimitry Andric// with GNU ld.
75ffd83dbSDimitry Andricclass FF<string name> : Flag<["--"], name>;
85ffd83dbSDimitry Andricclass JJ<string name>: Joined<["--"], name>;
95ffd83dbSDimitry Andric
105ffd83dbSDimitry Andricmulticlass EEq<string name, string help> {
115ffd83dbSDimitry Andric  def NAME: Separate<["--"], name>;
125ffd83dbSDimitry Andric  def NAME # _eq: Joined<["--"], name # "=">, Alias<!cast<Separate>(NAME)>,
135ffd83dbSDimitry Andric    HelpText<help>;
145ffd83dbSDimitry Andric}
155ffd83dbSDimitry Andric
165ffd83dbSDimitry Andricmulticlass BB<string name, string help1, string help2> {
175ffd83dbSDimitry Andric  def NAME: Flag<["--"], name>, HelpText<help1>;
185ffd83dbSDimitry Andric  def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
195ffd83dbSDimitry Andric}
205ffd83dbSDimitry Andric
210b57cec5SDimitry Andric// For options whose names are multiple letters, either one dash or
220b57cec5SDimitry Andric// two can precede the option name except those that start with 'o'.
230b57cec5SDimitry Andricclass F<string name>: Flag<["--", "-"], name>;
240b57cec5SDimitry Andricclass J<string name>: Joined<["--", "-"], name>;
250b57cec5SDimitry Andric
260b57cec5SDimitry Andricmulticlass Eq<string name, string help> {
270b57cec5SDimitry Andric  def NAME: Separate<["--", "-"], name>;
280b57cec5SDimitry Andric  def NAME # _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>,
290b57cec5SDimitry Andric    HelpText<help>;
300b57cec5SDimitry Andric}
310b57cec5SDimitry Andric
320b57cec5SDimitry Andricmulticlass B<string name, string help1, string help2> {
330b57cec5SDimitry Andric  def NAME: Flag<["--", "-"], name>, HelpText<help1>;
340b57cec5SDimitry Andric  def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText<help2>;
350b57cec5SDimitry Andric}
360b57cec5SDimitry Andric
370b57cec5SDimitry Andricdefm auxiliary: Eq<"auxiliary", "Set DT_AUXILIARY field to the specified name">;
380b57cec5SDimitry Andric
390b57cec5SDimitry Andricdef Bsymbolic: F<"Bsymbolic">, HelpText<"Bind defined symbols locally">;
400b57cec5SDimitry Andric
410b57cec5SDimitry Andricdef Bsymbolic_functions: F<"Bsymbolic-functions">,
420b57cec5SDimitry Andric  HelpText<"Bind defined function symbols locally">;
430b57cec5SDimitry Andric
440b57cec5SDimitry Andricdef Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries (default)">;
450b57cec5SDimitry Andric
460b57cec5SDimitry Andricdef Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">;
470b57cec5SDimitry Andric
480b57cec5SDimitry Andricdef build_id: F<"build-id">, HelpText<"Alias for --build-id=fast">;
490b57cec5SDimitry Andric
500b57cec5SDimitry Andricdef build_id_eq: J<"build-id=">, HelpText<"Generate build ID note">,
510b57cec5SDimitry Andric  MetaVarName<"[fast,md5,sha1,uuid,0x<hexstring>]">;
520b57cec5SDimitry Andric
530b57cec5SDimitry Andricdefm check_sections: B<"check-sections",
540b57cec5SDimitry Andric    "Check section addresses for overlaps (default)",
550b57cec5SDimitry Andric    "Do not check section addresses for overlaps">;
560b57cec5SDimitry Andric
570b57cec5SDimitry Andricdefm compress_debug_sections:
580b57cec5SDimitry Andric  Eq<"compress-debug-sections", "Compress DWARF debug sections">,
590b57cec5SDimitry Andric  MetaVarName<"[none,zlib]">;
600b57cec5SDimitry Andric
610b57cec5SDimitry Andricdefm defsym: Eq<"defsym", "Define a symbol alias">, MetaVarName<"<symbol>=<value>">;
620b57cec5SDimitry Andric
635ffd83dbSDimitry Andricdefm optimize_bb_jumps: BB<"optimize-bb-jumps",
645ffd83dbSDimitry Andric    "Remove direct jumps at the end to the next basic block",
655ffd83dbSDimitry Andric    "Do not remove any direct jumps at the end to the next basic block (default)">;
665ffd83dbSDimitry Andric
67*e8d8bef9SDimitry Andricdefm fortran_common : BB<"fortran-common",
68*e8d8bef9SDimitry Andric    "Search archive members for definitions to override COMMON symbols (default)",
69*e8d8bef9SDimitry Andric    "Do not search archive members for definitions to override COMMON symbols">;
70*e8d8bef9SDimitry Andric
710b57cec5SDimitry Andricdefm split_stack_adjust_size
720b57cec5SDimitry Andric    : Eq<"split-stack-adjust-size",
730b57cec5SDimitry Andric         "Specify adjustment to stack size when a split-stack function calls a "
740b57cec5SDimitry Andric         "non-split-stack function">,
750b57cec5SDimitry Andric      MetaVarName<"<value>">;
760b57cec5SDimitry Andric
770b57cec5SDimitry Andricdefm library_path:
780b57cec5SDimitry Andric  Eq<"library-path", "Add a directory to the library search path">, MetaVarName<"<dir>">;
790b57cec5SDimitry Andric
800b57cec5SDimitry Andricdef O: JoinedOrSeparate<["-"], "O">, HelpText<"Optimize output file size">;
810b57cec5SDimitry Andric
820b57cec5SDimitry Andricdefm Tbss: Eq<"Tbss", "Same as --section-start with .bss as the sectionname">;
830b57cec5SDimitry Andric
840b57cec5SDimitry Andricdefm Tdata: Eq<"Tdata", "Same as --section-start with .data as the sectionname">;
850b57cec5SDimitry Andric
860b57cec5SDimitry Andricdefm Ttext: Eq<"Ttext", "Same as --section-start with .text as the sectionname">;
870b57cec5SDimitry Andric
88480093f4SDimitry Andricdef Ttext_segment: Separate<["-", "--"], "Ttext-segment">;
89480093f4SDimitry Andric
900b57cec5SDimitry Andricdefm allow_multiple_definition: B<"allow-multiple-definition",
910b57cec5SDimitry Andric    "Allow multiple definitions",
920b57cec5SDimitry Andric    "Do not allow multiple definitions (default)">;
930b57cec5SDimitry Andric
940b57cec5SDimitry Andricdefm allow_shlib_undefined: B<"allow-shlib-undefined",
950b57cec5SDimitry Andric    "Allow unresolved references in shared libraries (default when linking a shared library)",
960b57cec5SDimitry Andric    "Do not allow unresolved references in shared libraries (default when linking an executable)">;
970b57cec5SDimitry Andric
985ffd83dbSDimitry Andricdefm apply_dynamic_relocs: BB<"apply-dynamic-relocs",
990b57cec5SDimitry Andric    "Apply link-time values for dynamic relocations",
1000b57cec5SDimitry Andric    "Do not apply link-time values for dynamic relocations (default)">;
1010b57cec5SDimitry Andric
1025ffd83dbSDimitry Andricdefm dependent_libraries: BB<"dependent-libraries",
1030b57cec5SDimitry Andric    "Process dependent library specifiers from input files (default)",
1040b57cec5SDimitry Andric    "Ignore dependent library specifiers from input files">;
1050b57cec5SDimitry Andric
1060b57cec5SDimitry Andricdefm as_needed: B<"as-needed",
1070b57cec5SDimitry Andric    "Only set DT_NEEDED for shared libraries if used",
1080b57cec5SDimitry Andric    "Always set DT_NEEDED for shared libraries (default)">;
1090b57cec5SDimitry Andric
1100b57cec5SDimitry Andricdefm call_graph_ordering_file:
1110b57cec5SDimitry Andric  Eq<"call-graph-ordering-file", "Layout sections to optimize the given callgraph">;
1120b57cec5SDimitry Andric
1135ffd83dbSDimitry Andricdefm call_graph_profile_sort: BB<"call-graph-profile-sort",
1140b57cec5SDimitry Andric    "Reorder sections with call graph profile (default)",
1150b57cec5SDimitry Andric    "Do not reorder sections with call graph profile">;
1160b57cec5SDimitry Andric
1170b57cec5SDimitry Andric// -chroot doesn't have a help text because it is an internal option.
1180b57cec5SDimitry Andricdef chroot: Separate<["--", "-"], "chroot">;
1190b57cec5SDimitry Andric
120*e8d8bef9SDimitry Andricdefm color_diagnostics: B<"color-diagnostics",
121*e8d8bef9SDimitry Andric  "Alias for --color-diagnostics=always",
122*e8d8bef9SDimitry Andric  "Alias for --color-diagnostics=never">;
1230b57cec5SDimitry Andricdef color_diagnostics_eq: J<"color-diagnostics=">,
124*e8d8bef9SDimitry Andric  HelpText<"Use colors in diagnostics (default: auto)">,
1250b57cec5SDimitry Andric  MetaVarName<"[auto,always,never]">;
1260b57cec5SDimitry Andric
1270b57cec5SDimitry Andricdefm cref: B<"cref",
1280b57cec5SDimitry Andric    "Output cross reference table",
1290b57cec5SDimitry Andric    "Do not output cross reference table">;
1300b57cec5SDimitry Andric
1310b57cec5SDimitry Andricdefm define_common: B<"define-common",
1320b57cec5SDimitry Andric    "Assign space to common symbols",
1330b57cec5SDimitry Andric    "Do not assign space to common symbols">;
1340b57cec5SDimitry Andric
1350b57cec5SDimitry Andricdefm demangle: B<"demangle",
1360b57cec5SDimitry Andric    "Demangle symbol names (default)",
1370b57cec5SDimitry Andric    "Do not demangle symbol names">;
1380b57cec5SDimitry Andric
139*e8d8bef9SDimitry Andricdefm dependency_file: EEq<"dependency-file", "Write a dependency file">,
140*e8d8bef9SDimitry Andric  MetaVarName<"<file>">;
141*e8d8bef9SDimitry Andric
1420b57cec5SDimitry Andricdef disable_new_dtags: F<"disable-new-dtags">,
1430b57cec5SDimitry Andric  HelpText<"Disable new dynamic tags">;
1440b57cec5SDimitry Andric
1450b57cec5SDimitry Andricdef discard_all: F<"discard-all">, HelpText<"Delete all local symbols">;
1460b57cec5SDimitry Andric
1470b57cec5SDimitry Andricdef discard_locals: F<"discard-locals">,
1480b57cec5SDimitry Andric  HelpText<"Delete temporary local symbols">;
1490b57cec5SDimitry Andric
1500b57cec5SDimitry Andricdef discard_none: F<"discard-none">,
1510b57cec5SDimitry Andric  HelpText<"Keep all symbols in the symbol table">;
1520b57cec5SDimitry Andric
1530b57cec5SDimitry Andricdefm dynamic_linker: Eq<"dynamic-linker", "Which dynamic linker to use">;
1540b57cec5SDimitry Andric
1555ffd83dbSDimitry Andricdefm dynamic_list : Eq<"dynamic-list",
1565ffd83dbSDimitry Andric   "Read a list of dynamic symbols. (executable) Put matched non-local defined"
1575ffd83dbSDimitry Andric   "symbols to the dynamic symbol table. (shared object) References to matched"
1585ffd83dbSDimitry Andric   "non-local STV_DEFAULT symbols shouldn't be bound to definitions within the "
1595ffd83dbSDimitry Andric   "shared object. Implies -Bsymbolic but does not set DF_SYMBOLIC">,
1605ffd83dbSDimitry Andric   MetaVarName<"<file>">;
1610b57cec5SDimitry Andric
1620b57cec5SDimitry Andricdefm eh_frame_hdr: B<"eh-frame-hdr",
1630b57cec5SDimitry Andric    "Request creation of .eh_frame_hdr section and PT_GNU_EH_FRAME segment header",
1640b57cec5SDimitry Andric    "Do not create .eh_frame_hdr section">;
1650b57cec5SDimitry Andric
1660b57cec5SDimitry Andricdef emit_relocs: F<"emit-relocs">, HelpText<"Generate relocations in output">;
1670b57cec5SDimitry Andric
1680b57cec5SDimitry Andricdef enable_new_dtags: F<"enable-new-dtags">,
1690b57cec5SDimitry Andric  HelpText<"Enable new dynamic tags (default)">;
1700b57cec5SDimitry Andric
1710b57cec5SDimitry Andricdef end_group: F<"end-group">,
1720b57cec5SDimitry Andric  HelpText<"Ignored for compatibility with GNU unless you pass --warn-backrefs">;
1730b57cec5SDimitry Andric
1740b57cec5SDimitry Andricdef end_lib: F<"end-lib">,
1750b57cec5SDimitry Andric  HelpText<"End a grouping of objects that should be treated as if they were together in an archive">;
1760b57cec5SDimitry Andric
1770b57cec5SDimitry Andricdefm entry: Eq<"entry", "Name of entry point symbol">,
1780b57cec5SDimitry Andric  MetaVarName<"<entry>">;
1790b57cec5SDimitry Andric
1800b57cec5SDimitry Andricdefm error_limit:
1810b57cec5SDimitry Andric  Eq<"error-limit", "Maximum number of errors to emit before stopping (0 = no limit)">;
1820b57cec5SDimitry Andric
1830b57cec5SDimitry Andricdef error_unresolved_symbols: F<"error-unresolved-symbols">,
1840b57cec5SDimitry Andric  HelpText<"Report unresolved symbols as errors">;
1850b57cec5SDimitry Andric
186*e8d8bef9SDimitry Andricdefm error_handling_script: EEq<"error-handling-script",
187*e8d8bef9SDimitry Andric    "Specify an error handling script">;
188*e8d8bef9SDimitry Andric
1890b57cec5SDimitry Andricdefm exclude_libs: Eq<"exclude-libs", "Exclude static libraries from automatic export">;
1900b57cec5SDimitry Andric
1915ffd83dbSDimitry Andricdefm execute_only: BB<"execute-only",
1920b57cec5SDimitry Andric    "Mark executable sections unreadable",
1930b57cec5SDimitry Andric    "Mark executable sections readable (default)">;
1940b57cec5SDimitry Andric
1950b57cec5SDimitry Andricdefm export_dynamic: B<"export-dynamic",
1960b57cec5SDimitry Andric    "Put symbols in the dynamic symbol table",
1970b57cec5SDimitry Andric    "Do not put symbols in the dynamic symbol table (default)">;
1980b57cec5SDimitry Andric
1995ffd83dbSDimitry Andricdefm export_dynamic_symbol : EEq<"export-dynamic-symbol",
2005ffd83dbSDimitry Andric    "(executable) Put matched symbols in the dynamic symbol table. "
2015ffd83dbSDimitry Andric    "(shared object) References to matched non-local STV_DEFAULT symbols "
2025ffd83dbSDimitry Andric    "shouldn't be bound to definitions within the shared object. "
2035ffd83dbSDimitry Andric    "Does not imply -Bsymbolic.">,
2045ffd83dbSDimitry Andric    MetaVarName<"glob">;
2050b57cec5SDimitry Andric
2060b57cec5SDimitry Andricdefm fatal_warnings: B<"fatal-warnings",
2070b57cec5SDimitry Andric    "Treat warnings as errors",
2080b57cec5SDimitry Andric    "Do not treat warnings as errors (default)">;
2090b57cec5SDimitry Andric
2100b57cec5SDimitry Andricdefm filter: Eq<"filter", "Set DT_FILTER field to the specified name">;
2110b57cec5SDimitry Andric
2120b57cec5SDimitry Andricdefm fini: Eq<"fini", "Specify a finalizer function">, MetaVarName<"<symbol>">;
2130b57cec5SDimitry Andric
2140b57cec5SDimitry Andricdef fix_cortex_a53_843419: F<"fix-cortex-a53-843419">,
2150b57cec5SDimitry Andric  HelpText<"Apply fixes for AArch64 Cortex-A53 erratum 843419">;
2160b57cec5SDimitry Andric
21785868e8aSDimitry Andricdef fix_cortex_a8: F<"fix-cortex-a8">,
21885868e8aSDimitry Andric  HelpText<"Apply fixes for ARM Cortex-A8 erratum 657417">;
21985868e8aSDimitry Andric
2200b57cec5SDimitry Andricdefm format: Eq<"format", "Change the input format of the inputs following this option">,
2210b57cec5SDimitry Andric  MetaVarName<"[default,elf,binary]">;
2220b57cec5SDimitry Andric
2230b57cec5SDimitry Andricdefm gc_sections: B<"gc-sections",
2240b57cec5SDimitry Andric    "Enable garbage collection of unused sections",
2250b57cec5SDimitry Andric    "Disable garbage collection of unused sections (default)">;
2260b57cec5SDimitry Andric
2275ffd83dbSDimitry Andricdefm gdb_index: BB<"gdb-index",
2280b57cec5SDimitry Andric    "Generate .gdb_index section",
2290b57cec5SDimitry Andric    "Do not generate .gdb_index section (default)">;
2300b57cec5SDimitry Andric
2315ffd83dbSDimitry Andricdefm gnu_unique: BB<"gnu-unique",
2320b57cec5SDimitry Andric  "Enable STB_GNU_UNIQUE symbol binding (default)",
2330b57cec5SDimitry Andric  "Disable STB_GNU_UNIQUE symbol binding">;
2340b57cec5SDimitry Andric
2350b57cec5SDimitry Andricdefm hash_style: Eq<"hash-style", "Specify hash style (sysv, gnu or both)">;
2360b57cec5SDimitry Andric
2370b57cec5SDimitry Andricdef help: F<"help">, HelpText<"Print option help">;
2380b57cec5SDimitry Andric
2390b57cec5SDimitry Andricdef icf_all: F<"icf=all">, HelpText<"Enable identical code folding">;
2400b57cec5SDimitry Andric
2410b57cec5SDimitry Andricdef icf_safe: F<"icf=safe">, HelpText<"Enable safe identical code folding">;
2420b57cec5SDimitry Andric
2430b57cec5SDimitry Andricdef icf_none: F<"icf=none">, HelpText<"Disable identical code folding (default)">;
2440b57cec5SDimitry Andric
2450b57cec5SDimitry Andricdef ignore_function_address_equality: F<"ignore-function-address-equality">,
2460b57cec5SDimitry Andric  HelpText<"lld can break the address equality of functions">;
2470b57cec5SDimitry Andric
2480b57cec5SDimitry Andricdef ignore_data_address_equality: F<"ignore-data-address-equality">,
2490b57cec5SDimitry Andric  HelpText<"lld can break the address equality of data">;
2500b57cec5SDimitry Andric
2510b57cec5SDimitry Andricdefm image_base: Eq<"image-base", "Set the base address">;
2520b57cec5SDimitry Andric
2530b57cec5SDimitry Andricdefm init: Eq<"init", "Specify an initializer function">,
2540b57cec5SDimitry Andric  MetaVarName<"<symbol>">;
2550b57cec5SDimitry Andric
2560b57cec5SDimitry Andricdefm just_symbols: Eq<"just-symbols", "Just link symbols">;
2570b57cec5SDimitry Andric
2580b57cec5SDimitry Andricdefm keep_unique: Eq<"keep-unique", "Do not fold this symbol during ICF">;
2590b57cec5SDimitry Andric
2600b57cec5SDimitry Andricdefm library: Eq<"library", "Root name of library to use">,
2610b57cec5SDimitry Andric  MetaVarName<"<libName>">;
2620b57cec5SDimitry Andric
2630b57cec5SDimitry Andricdef m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
2640b57cec5SDimitry Andric
2650b57cec5SDimitry Andricdefm Map: Eq<"Map", "Print a link map to the specified file">;
2660b57cec5SDimitry Andric
2670b57cec5SDimitry Andricdefm merge_exidx_entries: B<"merge-exidx-entries",
2680b57cec5SDimitry Andric    "Enable merging .ARM.exidx entries (default)",
2690b57cec5SDimitry Andric    "Disable merging .ARM.exidx entries">;
2700b57cec5SDimitry Andric
2715ffd83dbSDimitry Andricdefm mmap_output_file: BB<"mmap-output-file",
272480093f4SDimitry Andric    "Mmap the output file for writing (default)",
273480093f4SDimitry Andric    "Do not mmap the output file for writing">;
274480093f4SDimitry Andric
2750b57cec5SDimitry Andricdef nmagic: F<"nmagic">, MetaVarName<"<magic>">,
2760b57cec5SDimitry Andric  HelpText<"Do not page align sections, link against static libraries.">;
2770b57cec5SDimitry Andric
2780b57cec5SDimitry Andricdef nostdlib: F<"nostdlib">,
2790b57cec5SDimitry Andric  HelpText<"Only search directories specified on the command line">;
2800b57cec5SDimitry Andric
2810b57cec5SDimitry Andricdef no_dynamic_linker: F<"no-dynamic-linker">,
2820b57cec5SDimitry Andric  HelpText<"Inhibit output of .interp section">;
2830b57cec5SDimitry Andric
2840b57cec5SDimitry Andricdef noinhibit_exec: F<"noinhibit-exec">,
2850b57cec5SDimitry Andric  HelpText<"Retain the executable output file whenever it is still usable">;
2860b57cec5SDimitry Andric
2870b57cec5SDimitry Andricdef no_nmagic: F<"no-nmagic">, MetaVarName<"<magic>">,
2880b57cec5SDimitry Andric  HelpText<"Page align sections (default)">;
2890b57cec5SDimitry Andric
2900b57cec5SDimitry Andricdef no_omagic: F<"no-omagic">, MetaVarName<"<magic>">,
2910b57cec5SDimitry Andric  HelpText<"Do not set the text data sections to be writable, page align sections (default)">;
2920b57cec5SDimitry Andric
2930b57cec5SDimitry Andricdef no_undefined: F<"no-undefined">,
2940b57cec5SDimitry Andric  HelpText<"Report unresolved symbols even if the linker is creating a shared library">;
2950b57cec5SDimitry Andric
2960b57cec5SDimitry Andricdef o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
2970b57cec5SDimitry Andric  HelpText<"Path to file to write output">;
2980b57cec5SDimitry Andric
2990b57cec5SDimitry Andricdef oformat: Separate<["--"], "oformat">, MetaVarName<"<format>">,
3000b57cec5SDimitry Andric  HelpText<"Specify the binary format for the output object file">;
3010b57cec5SDimitry Andric
3025ffd83dbSDimitry Andricdef omagic: FF<"omagic">, MetaVarName<"<magic>">,
3030b57cec5SDimitry Andric  HelpText<"Set the text and data sections to be readable and writable, do not page align sections, link against static libraries">;
3040b57cec5SDimitry Andric
3050b57cec5SDimitry Andricdefm orphan_handling:
3060b57cec5SDimitry Andric  Eq<"orphan-handling", "Control how orphan sections are handled when linker script used">;
3070b57cec5SDimitry Andric
3080b57cec5SDimitry Andricdefm pack_dyn_relocs:
3090b57cec5SDimitry Andric  Eq<"pack-dyn-relocs", "Pack dynamic relocations in the given format">,
3100b57cec5SDimitry Andric  MetaVarName<"[none,android,relr,android+relr]">;
3110b57cec5SDimitry Andric
3125ffd83dbSDimitry Andricdefm use_android_relr_tags: BB<"use-android-relr-tags",
3130b57cec5SDimitry Andric    "Use SHT_ANDROID_RELR / DT_ANDROID_RELR* tags instead of SHT_RELR / DT_RELR*",
3140b57cec5SDimitry Andric    "Use SHT_RELR / DT_RELR* tags (default)">;
3150b57cec5SDimitry Andric
3160b57cec5SDimitry Andricdef pic_veneer: F<"pic-veneer">,
3170b57cec5SDimitry Andric  HelpText<"Always generate position independent thunks (veneers)">;
3180b57cec5SDimitry Andric
3190b57cec5SDimitry Andricdefm pie: B<"pie",
3200b57cec5SDimitry Andric    "Create a position independent executable",
3210b57cec5SDimitry Andric    "Do not create a position independent executable (default)">;
3220b57cec5SDimitry Andric
3230b57cec5SDimitry Andricdefm print_gc_sections: B<"print-gc-sections",
3240b57cec5SDimitry Andric    "List removed unused sections",
3250b57cec5SDimitry Andric    "Do not list removed unused sections (default)">;
3260b57cec5SDimitry Andric
3270b57cec5SDimitry Andricdefm print_icf_sections: B<"print-icf-sections",
3280b57cec5SDimitry Andric    "List identical folded sections",
3290b57cec5SDimitry Andric    "Do not list identical folded sections (default)">;
3300b57cec5SDimitry Andric
3315ffd83dbSDimitry Andricdef print_archive_stats: J<"print-archive-stats=">,
3325ffd83dbSDimitry Andric  HelpText<"Write archive usage statistics to the specified file. "
3335ffd83dbSDimitry Andric           "Print the numbers of members and fetched members for each archive">;
3345ffd83dbSDimitry Andric
3350b57cec5SDimitry Andricdefm print_symbol_order: Eq<"print-symbol-order",
336480093f4SDimitry Andric  "Print a symbol order specified by --call-graph-ordering-file into the specified file">;
3370b57cec5SDimitry Andric
3380b57cec5SDimitry Andricdef pop_state: F<"pop-state">,
3390b57cec5SDimitry Andric  HelpText<"Undo the effect of -push-state">;
3400b57cec5SDimitry Andric
3410b57cec5SDimitry Andricdef push_state: F<"push-state">,
3420b57cec5SDimitry Andric  HelpText<"Save the current state of -as-needed, -static and -whole-archive">;
3430b57cec5SDimitry Andric
3440b57cec5SDimitry Andricdef print_map: F<"print-map">,
3450b57cec5SDimitry Andric  HelpText<"Print a link map to the standard output">;
3460b57cec5SDimitry Andric
347*e8d8bef9SDimitry Andricdefm reproduce:
348*e8d8bef9SDimitry Andric  Eq<"reproduce",
349*e8d8bef9SDimitry Andric     "Write tar file containing inputs and command to reproduce link">;
3500b57cec5SDimitry Andric
3515ffd83dbSDimitry Andricdefm rosegment: BB<"rosegment",
3525ffd83dbSDimitry Andric  "Put read-only non-executable sections in their own segment (default)",
3535ffd83dbSDimitry Andric  "Do not put read-only non-executable sections in their own segment">;
3545ffd83dbSDimitry Andric
3550b57cec5SDimitry Andricdefm rpath: Eq<"rpath", "Add a DT_RUNPATH to the output">;
3560b57cec5SDimitry Andric
3570b57cec5SDimitry Andricdef relocatable: F<"relocatable">, HelpText<"Create relocatable object file">;
3580b57cec5SDimitry Andric
3590b57cec5SDimitry Andricdefm retain_symbols_file:
3600b57cec5SDimitry Andric  Eq<"retain-symbols-file", "Retain only the symbols listed in the file">,
3610b57cec5SDimitry Andric  MetaVarName<"<file>">;
3620b57cec5SDimitry Andric
3630b57cec5SDimitry Andricdefm script: Eq<"script", "Read linker script">;
3640b57cec5SDimitry Andric
3650b57cec5SDimitry Andricdefm section_start: Eq<"section-start", "Set address of section">,
3660b57cec5SDimitry Andric  MetaVarName<"<address>">;
3670b57cec5SDimitry Andric
3680b57cec5SDimitry Andricdef shared: F<"shared">, HelpText<"Build a shared object">;
3690b57cec5SDimitry Andric
3700b57cec5SDimitry Andricdefm soname: Eq<"soname", "Set DT_SONAME">;
3710b57cec5SDimitry Andric
3720b57cec5SDimitry Andricdefm sort_section:
3730b57cec5SDimitry Andric  Eq<"sort-section", "Specifies sections sorting rule when linkerscript is used">;
3740b57cec5SDimitry Andric
3750b57cec5SDimitry Andricdef start_group: F<"start-group">,
3760b57cec5SDimitry Andric  HelpText<"Ignored for compatibility with GNU unless you pass --warn-backrefs">;
3770b57cec5SDimitry Andric
3780b57cec5SDimitry Andricdef start_lib: F<"start-lib">,
3790b57cec5SDimitry Andric  HelpText<"Start a grouping of objects that should be treated as if they were together in an archive">;
3800b57cec5SDimitry Andric
3810b57cec5SDimitry Andricdef strip_all: F<"strip-all">, HelpText<"Strip all symbols">;
3820b57cec5SDimitry Andric
3830b57cec5SDimitry Andricdef strip_debug: F<"strip-debug">, HelpText<"Strip debugging information">;
3840b57cec5SDimitry Andric
3850b57cec5SDimitry Andricdefm symbol_ordering_file:
3860b57cec5SDimitry Andric  Eq<"symbol-ordering-file", "Layout sections to place symbols in the order specified by symbol ordering file">;
3870b57cec5SDimitry Andric
3880b57cec5SDimitry Andricdefm sysroot: Eq<"sysroot", "Set the system root">;
3890b57cec5SDimitry Andric
3900b57cec5SDimitry Andricdef target1_rel: F<"target1-rel">, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_REL32">;
3910b57cec5SDimitry Andric
3920b57cec5SDimitry Andricdef target1_abs: F<"target1-abs">, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_ABS32 (default)">;
3930b57cec5SDimitry Andric
3940b57cec5SDimitry Andricdefm target2:
3950b57cec5SDimitry Andric  Eq<"target2", "Interpret R_ARM_TARGET2 as <type>, where <type> is one of rel, abs, or got-rel">,
3960b57cec5SDimitry Andric  MetaVarName<"<type>">;
3970b57cec5SDimitry Andric
3985ffd83dbSDimitry Andricdefm threads
3995ffd83dbSDimitry Andric    : Eq<"threads",
4005ffd83dbSDimitry Andric         "Number of threads. '1' disables multi-threading. By default all "
4015ffd83dbSDimitry Andric         "available hardware threads are used">;
4025ffd83dbSDimitry Andric
403*e8d8bef9SDimitry Andricdef time_trace: FF<"time-trace">, HelpText<"Record time trace">;
404*e8d8bef9SDimitry Andricdef time_trace_file_eq: JJ<"time-trace-file=">, HelpText<"Specify time trace output file">;
4055ffd83dbSDimitry Andric
406*e8d8bef9SDimitry Andricdefm time_trace_granularity: EEq<"time-trace-granularity",
4075ffd83dbSDimitry Andric  "Minimum time granularity (in microseconds) traced by time profiler">;
4080b57cec5SDimitry Andric
409*e8d8bef9SDimitry Andricdefm toc_optimize : BB<"toc-optimize",
4100b57cec5SDimitry Andric    "(PowerPC64) Enable TOC related optimizations (default)",
4110b57cec5SDimitry Andric    "(PowerPC64) Disable TOC related optimizations">;
4120b57cec5SDimitry Andric
413*e8d8bef9SDimitry Andricdefm pcrel_optimize : BB<"pcrel-optimize",
414*e8d8bef9SDimitry Andric    "(PowerPC64) Enable PC-relative optimizations (default)",
415*e8d8bef9SDimitry Andric    "(PowerPC64) Disable PC-relative optimizations">;
416*e8d8bef9SDimitry Andric
4170b57cec5SDimitry Andricdef trace: F<"trace">, HelpText<"Print the names of the input files">;
4180b57cec5SDimitry Andric
4190b57cec5SDimitry Andricdefm trace_symbol: Eq<"trace-symbol", "Trace references to symbols">;
4200b57cec5SDimitry Andric
4210b57cec5SDimitry Andricdefm undefined: Eq<"undefined", "Force undefined symbol during linking">,
4220b57cec5SDimitry Andric  MetaVarName<"<symbol>">;
4230b57cec5SDimitry Andric
424*e8d8bef9SDimitry Andricdefm undefined_glob: EEq<"undefined-glob", "Force undefined symbol during linking">,
4250b57cec5SDimitry Andric  MetaVarName<"<pattern>">;
4260b57cec5SDimitry Andric
4275ffd83dbSDimitry Andricdef unique: F<"unique">, HelpText<"Creates a separate output section for every orphan input section">;
4285ffd83dbSDimitry Andric
4290b57cec5SDimitry Andricdefm unresolved_symbols:
4300b57cec5SDimitry Andric  Eq<"unresolved-symbols", "Determine how to handle unresolved symbols">;
4310b57cec5SDimitry Andric
4320b57cec5SDimitry Andricdefm undefined_version: B<"undefined-version",
4330b57cec5SDimitry Andric  "Allow unused version in version script (default)",
4340b57cec5SDimitry Andric  "Report version scripts that refer undefined symbols">;
4350b57cec5SDimitry Andric
4360b57cec5SDimitry Andricdefm rsp_quoting: Eq<"rsp-quoting", "Quoting style for response files">,
4370b57cec5SDimitry Andric  MetaVarName<"[posix,windows]">;
4380b57cec5SDimitry Andric
4390b57cec5SDimitry Andricdef v: Flag<["-"], "v">, HelpText<"Display the version number">;
4400b57cec5SDimitry Andric
4410b57cec5SDimitry Andricdef verbose: F<"verbose">, HelpText<"Verbose mode">;
4420b57cec5SDimitry Andric
4430b57cec5SDimitry Andricdef version: F<"version">, HelpText<"Display the version number and exit">;
4440b57cec5SDimitry Andric
4450b57cec5SDimitry Andricdefm version_script: Eq<"version-script", "Read a version script">;
4460b57cec5SDimitry Andric
4475ffd83dbSDimitry Andricdefm warn_backrefs: BB<"warn-backrefs",
4480b57cec5SDimitry Andric    "Warn about backward symbol references to fetch archive members",
4490b57cec5SDimitry Andric    "Do not warn about backward symbol references to fetch archive members (default)">;
4500b57cec5SDimitry Andric
4515ffd83dbSDimitry Andricdefm warn_backrefs_exclude
4525ffd83dbSDimitry Andric    : EEq<"warn-backrefs-exclude",
4535ffd83dbSDimitry Andric         "Glob describing an archive (or an object file within --start-lib) "
4545ffd83dbSDimitry Andric         "which should be ignored for --warn-backrefs.">,
4555ffd83dbSDimitry Andric      MetaVarName<"<glob>">;
4565ffd83dbSDimitry Andric
4570b57cec5SDimitry Andricdefm warn_common: B<"warn-common",
4580b57cec5SDimitry Andric    "Warn about duplicate common symbols",
4590b57cec5SDimitry Andric    "Do not warn about duplicate common symbols (default)">;
4600b57cec5SDimitry Andric
4615ffd83dbSDimitry Andricdefm warn_ifunc_textrel: BB<"warn-ifunc-textrel",
4620b57cec5SDimitry Andric    "Warn about using ifunc symbols with text relocations",
4630b57cec5SDimitry Andric    "Do not warn about using ifunc symbols with text relocations (default)">;
4640b57cec5SDimitry Andric
4655ffd83dbSDimitry Andricdefm warn_symbol_ordering: BB<"warn-symbol-ordering",
4660b57cec5SDimitry Andric    "Warn about problems with the symbol ordering file (default)",
4670b57cec5SDimitry Andric    "Do not warn about problems with the symbol ordering file">;
4680b57cec5SDimitry Andric
4690b57cec5SDimitry Andricdef warn_unresolved_symbols: F<"warn-unresolved-symbols">,
4700b57cec5SDimitry Andric  HelpText<"Report unresolved symbols as warnings">;
4710b57cec5SDimitry Andric
4720b57cec5SDimitry Andricdefm whole_archive: B<"whole-archive",
4730b57cec5SDimitry Andric    "Force load of all members in a static library",
4740b57cec5SDimitry Andric    "Do not force load of all members in a static library (default)">;
4750b57cec5SDimitry Andric
476*e8d8bef9SDimitry Andricdefm wrap : Eq<"wrap", "Redirect symbol references to __wrap_symbol and "
477*e8d8bef9SDimitry Andric                       "__real_symbol references to symbol">,
478*e8d8bef9SDimitry Andric            MetaVarName<"<symbol>">;
4790b57cec5SDimitry Andric
4800b57cec5SDimitry Andricdef z: JoinedOrSeparate<["-"], "z">, MetaVarName<"<option>">,
4810b57cec5SDimitry Andric  HelpText<"Linker option extensions">;
4820b57cec5SDimitry Andric
4830b57cec5SDimitry Andricdef visual_studio_diagnostics_format : F<"vs-diagnostics">,
484480093f4SDimitry AndricHelpText<"Format diagnostics for Visual Studio compatibility">;
4850b57cec5SDimitry Andric
4860b57cec5SDimitry Andric// Aliases
4870b57cec5SDimitry Andricdef: Separate<["-"], "f">, Alias<auxiliary>, HelpText<"Alias for --auxiliary">;
4880b57cec5SDimitry Andricdef: F<"call_shared">, Alias<Bdynamic>, HelpText<"Alias for --Bdynamic">;
4890b57cec5SDimitry Andricdef: F<"dy">, Alias<Bdynamic>, HelpText<"Alias for --Bdynamic">;
4900b57cec5SDimitry Andricdef: F<"dn">, Alias<Bstatic>, HelpText<"Alias for --Bstatic">;
4910b57cec5SDimitry Andricdef: F<"non_shared">, Alias<Bstatic>, HelpText<"Alias for --Bstatic">;
4920b57cec5SDimitry Andricdef: F<"static">, Alias<Bstatic>, HelpText<"Alias for --Bstatic">;
4930b57cec5SDimitry Andricdef: Flag<["-"], "d">, Alias<define_common>, HelpText<"Alias for --define-common">;
4940b57cec5SDimitry Andricdef: F<"dc">, Alias<define_common>, HelpText<"Alias for --define-common">;
4950b57cec5SDimitry Andricdef: F<"dp">, Alias<define_common>, HelpText<"Alias for --define-common">;
4960b57cec5SDimitry Andricdef: Flag<["-"], "x">, Alias<discard_all>, HelpText<"Alias for --discard-all">;
4970b57cec5SDimitry Andricdef: Flag<["-"], "X">, Alias<discard_locals>, HelpText<"Alias for --discard-locals">;
4980b57cec5SDimitry Andricdef: Flag<["-"], "q">, Alias<emit_relocs>, HelpText<"Alias for --emit-relocs">;
4990b57cec5SDimitry Andricdef: Flag<["-"], ")">, Alias<end_group>, HelpText<"Alias for --end-group">;
5000b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "e">, Alias<entry>, HelpText<"Alias for --entry">;
5010b57cec5SDimitry Andricdef: Flag<["-"], "E">, Alias<export_dynamic>, HelpText<"Alias for --export-dynamic">;
5020b57cec5SDimitry Andricdef: Separate<["-"], "F">, Alias<filter>, HelpText<"Alias for --filter">;
5030b57cec5SDimitry Andricdef: Separate<["-"], "b">, Alias<format>, HelpText<"Alias for --format">;
5040b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "l">, Alias<library>, HelpText<"Alias for --library">;
5050b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "L">, Alias<library_path>, HelpText<"Alias for --library-path">;
5060b57cec5SDimitry Andricdef: F<"no-pic-executable">, Alias<no_pie>, HelpText<"Alias for --no-pie">;
5070b57cec5SDimitry Andricdef: Flag<["-"], "n">, Alias<nmagic>, HelpText<"Alias for --nmagic">;
5080b57cec5SDimitry Andricdef: Flag<["-"], "N">, Alias<omagic>, HelpText<"Alias for --omagic">;
5090b57cec5SDimitry Andricdef: Joined<["--"], "output=">, Alias<o>, HelpText<"Alias for -o">;
5100b57cec5SDimitry Andricdef: Separate<["--"], "output">, Alias<o>, HelpText<"Alias for -o">;
5110b57cec5SDimitry Andricdef: F<"pic-executable">, Alias<pie>, HelpText<"Alias for --pie">;
5120b57cec5SDimitry Andricdef: Flag<["-"], "M">, Alias<print_map>, HelpText<"Alias for --print-map">;
5130b57cec5SDimitry Andricdef: Flag<["-"], "r">, Alias<relocatable>, HelpText<"Alias for --relocatable">;
5140b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "R">, Alias<rpath>, HelpText<"Alias for --rpath">;
5150b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "T">, Alias<script>, HelpText<"Alias for --script">;
5160b57cec5SDimitry Andricdef: F<"Bshareable">, Alias<shared>, HelpText<"Alias for --shared">;
5170b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "h">, Alias<soname>, HelpText<"Alias for --soname">;
5180b57cec5SDimitry Andricdef: Flag<["-"], "(">, Alias<start_group>, HelpText<"Alias for --start-group">;
5190b57cec5SDimitry Andricdef: Flag<["-"], "s">, Alias<strip_all>, HelpText<"Alias for --strip-all">;
5200b57cec5SDimitry Andricdef: Flag<["-"], "S">, Alias<strip_debug>, HelpText<"Alias for --strip-debug">;
5210b57cec5SDimitry Andricdef: Flag<["-"], "t">, Alias<trace>, HelpText<"Alias for --trace">;
522480093f4SDimitry Andricdef: Joined<["-", "--"], "Ttext-segment=">, Alias<Ttext_segment>;
5230b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "y">, Alias<trace_symbol>, HelpText<"Alias for --trace-symbol">;
5240b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "u">, Alias<undefined>, HelpText<"Alias for --undefined">;
5250b57cec5SDimitry Andricdef: Flag<["-"], "V">, Alias<version>, HelpText<"Alias for --version">;
5260b57cec5SDimitry Andric
5270b57cec5SDimitry Andric// LTO-related options.
5285ffd83dbSDimitry Andricdef lto_aa_pipeline: JJ<"lto-aa-pipeline=">,
5290b57cec5SDimitry Andric  HelpText<"AA pipeline to run during LTO. Used in conjunction with -lto-newpm-passes">;
5305ffd83dbSDimitry Andricdef lto_debug_pass_manager: FF<"lto-debug-pass-manager">,
5310b57cec5SDimitry Andric  HelpText<"Debug new pass manager">;
5325ffd83dbSDimitry Andricdef lto_emit_asm: FF<"lto-emit-asm">,
5335ffd83dbSDimitry Andric  HelpText<"Emit assembly code">;
534*e8d8bef9SDimitry Andricdefm lto_legacy_pass_manager: BB<"lto-legacy-pass-manager",
535*e8d8bef9SDimitry Andric  "Use the legacy pass manager in LLVM",
536*e8d8bef9SDimitry Andric  "Use the new pass manager in LLVM">;
5375ffd83dbSDimitry Andricdef lto_newpm_passes: JJ<"lto-newpm-passes=">,
5380b57cec5SDimitry Andric  HelpText<"Passes to run during LTO">;
5395ffd83dbSDimitry Andricdef lto_O: JJ<"lto-O">, MetaVarName<"<opt-level>">,
5400b57cec5SDimitry Andric  HelpText<"Optimization level for LTO">;
5415ffd83dbSDimitry Andricdef lto_partitions: JJ<"lto-partitions=">,
5420b57cec5SDimitry Andric  HelpText<"Number of LTO codegen partitions">;
5435ffd83dbSDimitry Andricdef lto_cs_profile_generate: FF<"lto-cs-profile-generate">,
544480093f4SDimitry Andric  HelpText<"Perform context sensitive PGO instrumentation">;
5455ffd83dbSDimitry Andricdef lto_cs_profile_file: JJ<"lto-cs-profile-file=">,
5460b57cec5SDimitry Andric  HelpText<"Context sensitive profile file path">;
5475ffd83dbSDimitry Andricdef lto_obj_path_eq: JJ<"lto-obj-path=">;
5485ffd83dbSDimitry Andricdef lto_sample_profile: JJ<"lto-sample-profile=">,
5490b57cec5SDimitry Andric  HelpText<"Sample profile file path">;
550*e8d8bef9SDimitry Andricdefm lto_whole_program_visibility: BB<"lto-whole-program-visibility",
551*e8d8bef9SDimitry Andric  "Asserts that the LTO link has whole program visibility",
552*e8d8bef9SDimitry Andric  "Asserts that the LTO link does not have whole program visibility">;
553*e8d8bef9SDimitry Andricdef lto_pseudo_probe_for_profiling: F<"lto-pseudo-probe-for-profiling">,
554*e8d8bef9SDimitry Andric  HelpText<"Emit pseudo probes for sample profiling">;
5550b57cec5SDimitry Andricdef disable_verify: F<"disable-verify">;
5560b57cec5SDimitry Andricdefm mllvm: Eq<"mllvm", "Additional arguments to forward to LLVM's option processing">;
5570b57cec5SDimitry Andricdef opt_remarks_filename: Separate<["--"], "opt-remarks-filename">,
5580b57cec5SDimitry Andric  HelpText<"YAML output file for optimization remarks">;
559*e8d8bef9SDimitry Andricdefm opt_remarks_hotness_threshold: EEq<"opt-remarks-hotness-threshold",
560*e8d8bef9SDimitry Andric  "Minimum profile count required for an optimization remark to be output."
561*e8d8bef9SDimitry Andric  " Use 'auto' to apply the threshold from profile summary.">,
562*e8d8bef9SDimitry Andric  MetaVarName<"<value>">;
5630b57cec5SDimitry Andricdef opt_remarks_passes: Separate<["--"], "opt-remarks-passes">,
5640b57cec5SDimitry Andric  HelpText<"Regex for the passes that need to be serialized to the output file">;
5655ffd83dbSDimitry Andricdef opt_remarks_with_hotness: FF<"opt-remarks-with-hotness">,
5660b57cec5SDimitry Andric  HelpText<"Include hotness information in the optimization remarks file">;
5670b57cec5SDimitry Andricdef opt_remarks_format: Separate<["--"], "opt-remarks-format">,
5680b57cec5SDimitry Andric  HelpText<"The format used for serializing remarks (default: YAML)">;
569*e8d8bef9SDimitry Andricdef save_temps: F<"save-temps">, HelpText<"Save intermediate LTO compilation results">;
570*e8d8bef9SDimitry Andricdef lto_basic_block_sections: JJ<"lto-basic-block-sections=">,
5715ffd83dbSDimitry Andric  HelpText<"Enable basic block sections for LTO">;
572*e8d8bef9SDimitry Andricdefm lto_unique_basic_block_section_names: BB<"lto-unique-basic-block-section-names",
5735ffd83dbSDimitry Andric    "Give unique names to every basic block section for LTO",
5745ffd83dbSDimitry Andric    "Do not give unique names to every basic block section for LTO (default)">;
5755ffd83dbSDimitry Andricdef shuffle_sections: JJ<"shuffle-sections=">, MetaVarName<"<seed>">,
5765ffd83dbSDimitry Andric  HelpText<"Shuffle input sections using the given seed. If 0, use a random seed">;
5775ffd83dbSDimitry Andricdef thinlto_cache_dir: JJ<"thinlto-cache-dir=">,
5780b57cec5SDimitry Andric  HelpText<"Path to ThinLTO cached object file directory">;
5795ffd83dbSDimitry Andricdefm thinlto_cache_policy: EEq<"thinlto-cache-policy", "Pruning policy for the ThinLTO cache">;
5805ffd83dbSDimitry Andricdef thinlto_emit_imports_files: FF<"thinlto-emit-imports-files">;
5815ffd83dbSDimitry Andricdef thinlto_index_only: FF<"thinlto-index-only">;
5825ffd83dbSDimitry Andricdef thinlto_index_only_eq: JJ<"thinlto-index-only=">;
5835ffd83dbSDimitry Andricdef thinlto_jobs: JJ<"thinlto-jobs=">,
5845ffd83dbSDimitry Andric  HelpText<"Number of ThinLTO jobs. Default to --threads=">;
5855ffd83dbSDimitry Andricdef thinlto_object_suffix_replace_eq: JJ<"thinlto-object-suffix-replace=">;
5865ffd83dbSDimitry Andricdef thinlto_prefix_replace_eq: JJ<"thinlto-prefix-replace=">;
5875ffd83dbSDimitry Andricdef thinlto_single_module_eq: JJ<"thinlto-single-module=">,
5885ffd83dbSDimitry Andric  HelpText<"Specific a single module to compile in ThinLTO mode, for debugging only">;
5890b57cec5SDimitry Andric
5905ffd83dbSDimitry Andricdef: J<"plugin-opt=O">, Alias<lto_O>, HelpText<"Alias for --lto-O">;
5910b57cec5SDimitry Andricdef: F<"plugin-opt=debug-pass-manager">,
5925ffd83dbSDimitry Andric  Alias<lto_debug_pass_manager>, HelpText<"Alias for --lto-debug-pass-manager">;
5935ffd83dbSDimitry Andricdef: F<"plugin-opt=disable-verify">, Alias<disable_verify>, HelpText<"Alias for --disable-verify">;
5940b57cec5SDimitry Andricdef plugin_opt_dwo_dir_eq: J<"plugin-opt=dwo_dir=">,
5950b57cec5SDimitry Andric  HelpText<"Directory to store .dwo files when LTO and debug fission are used">;
5965ffd83dbSDimitry Andricdef plugin_opt_emit_asm: F<"plugin-opt=emit-asm">,
5975ffd83dbSDimitry Andric  Alias<lto_emit_asm>, HelpText<"Alias for --lto-emit-asm">;
5980b57cec5SDimitry Andricdef plugin_opt_emit_llvm: F<"plugin-opt=emit-llvm">;
5995ffd83dbSDimitry Andricdef: J<"plugin-opt=jobs=">, Alias<thinlto_jobs>, HelpText<"Alias for --thinlto-jobs">;
6005ffd83dbSDimitry Andricdef: J<"plugin-opt=lto-partitions=">, Alias<lto_partitions>, HelpText<"Alias for --lto-partitions">;
6010b57cec5SDimitry Andricdef plugin_opt_mcpu_eq: J<"plugin-opt=mcpu=">;
6020b57cec5SDimitry Andricdef: F<"plugin-opt=new-pass-manager">,
603*e8d8bef9SDimitry Andric  Alias<no_lto_legacy_pass_manager>, HelpText<"Alias for --no-lto-legacy-pass-manager">;
604*e8d8bef9SDimitry Andricdef: F<"plugin-opt=legacy-pass-manager">,
605*e8d8bef9SDimitry Andric  Alias<lto_legacy_pass_manager>, HelpText<"Alias for --no-legacy-pass-manager">;
6060b57cec5SDimitry Andricdef: F<"plugin-opt=cs-profile-generate">,
6075ffd83dbSDimitry Andric  Alias<lto_cs_profile_generate>, HelpText<"Alias for --lto-cs-profile-generate">;
6080b57cec5SDimitry Andricdef: J<"plugin-opt=cs-profile-path=">,
6095ffd83dbSDimitry Andric  Alias<lto_cs_profile_file>, HelpText<"Alias for --lto-cs-profile-file">;
61085868e8aSDimitry Andricdef: J<"plugin-opt=obj-path=">,
61185868e8aSDimitry Andric  Alias<lto_obj_path_eq>,
6125ffd83dbSDimitry Andric  HelpText<"Alias for --lto-obj-path=">;
613*e8d8bef9SDimitry Andricdef: J<"plugin-opt=opt-remarks-filename=">,
614*e8d8bef9SDimitry Andric  Alias<opt_remarks_filename>,
615*e8d8bef9SDimitry Andric  HelpText<"Alias for --opt-remarks-filename">;
616*e8d8bef9SDimitry Andricdef: J<"plugin-opt=opt-remarks-passes=">,
617*e8d8bef9SDimitry Andric  Alias<opt_remarks_passes>,
618*e8d8bef9SDimitry Andric  HelpText<"Alias for --opt-remarks-passes">;
619*e8d8bef9SDimitry Andricdef: J<"plugin-opt=opt-remarks-format=">,
620*e8d8bef9SDimitry Andric  Alias<opt_remarks_format>,
621*e8d8bef9SDimitry Andric  HelpText<"Alias for --opt-remarks-format">;
622*e8d8bef9SDimitry Andricdef: F<"plugin-opt=opt-remarks-with-hotness">,
623*e8d8bef9SDimitry Andric  Alias<opt_remarks_with_hotness>,
624*e8d8bef9SDimitry Andric  HelpText<"Alias for --opt-remarks-with_hotness">;
625*e8d8bef9SDimitry Andricdef: J<"plugin-opt=opt-remarks-hotness-threshold=">,
626*e8d8bef9SDimitry Andric  Alias<opt_remarks_hotness_threshold>,
627*e8d8bef9SDimitry Andric  HelpText<"Alias for --opt-remarks-hotness-threshold">;
628*e8d8bef9SDimitry Andricdef: J<"plugin-opt=pseudo-probe-for-profiling">,
629*e8d8bef9SDimitry Andric  Alias<lto_pseudo_probe_for_profiling>, HelpText<"Alias for --lto-pseudo-probe-for-profiling">;
6300b57cec5SDimitry Andricdef: J<"plugin-opt=sample-profile=">,
6315ffd83dbSDimitry Andric  Alias<lto_sample_profile>, HelpText<"Alias for --lto-sample-profile">;
6325ffd83dbSDimitry Andricdef: F<"plugin-opt=save-temps">, Alias<save_temps>, HelpText<"Alias for --save-temps">;
63385868e8aSDimitry Andricdef: F<"plugin-opt=thinlto-emit-imports-files">,
63485868e8aSDimitry Andric  Alias<thinlto_emit_imports_files>,
6355ffd83dbSDimitry Andric  HelpText<"Alias for --thinlto-emit-imports-files">;
63685868e8aSDimitry Andricdef: F<"plugin-opt=thinlto-index-only">,
63785868e8aSDimitry Andric  Alias<thinlto_index_only>,
6385ffd83dbSDimitry Andric  HelpText<"Alias for --thinlto-index-only">;
63985868e8aSDimitry Andricdef: J<"plugin-opt=thinlto-index-only=">,
64085868e8aSDimitry Andric  Alias<thinlto_index_only_eq>,
6415ffd83dbSDimitry Andric  HelpText<"Alias for --thinlto-index-only=">;
64285868e8aSDimitry Andricdef: J<"plugin-opt=thinlto-object-suffix-replace=">,
64385868e8aSDimitry Andric Alias<thinlto_object_suffix_replace_eq>,
6445ffd83dbSDimitry Andric HelpText<"Alias for --thinlto-object-suffix-replace=">;
64585868e8aSDimitry Andricdef: J<"plugin-opt=thinlto-prefix-replace=">,
64685868e8aSDimitry Andric  Alias<thinlto_prefix_replace_eq>,
6475ffd83dbSDimitry Andric  HelpText<"Alias for --thinlto-prefix-replace=">;
6480b57cec5SDimitry Andric
6490b57cec5SDimitry Andric// Ignore LTO plugin-related options.
6500b57cec5SDimitry Andric// clang -flto passes -plugin and -plugin-opt to the linker. This is required
6510b57cec5SDimitry Andric// for ld.gold and ld.bfd to get LTO working. But it's not for lld which doesn't
6520b57cec5SDimitry Andric// rely on a plugin. Instead of detecting which linker is used on clang side we
6530b57cec5SDimitry Andric// just ignore the option on lld side as it's easier. In fact, the linker could
6540b57cec5SDimitry Andric// be called 'ld' and understanding which linker is used would require parsing of
6550b57cec5SDimitry Andric// --version output.
6560b57cec5SDimitry Andricdefm plugin: Eq<"plugin", "Ignored for compatibility with GNU linkers">;
6570b57cec5SDimitry Andric
6585ffd83dbSDimitry Andricdef plugin_opt_eq_minus: J<"plugin-opt=-">,
6595ffd83dbSDimitry Andric  HelpText<"Specify an LLVM option for compatibility with LLVMgold.so">;
6605ffd83dbSDimitry Andricdef: J<"plugin-opt=thinlto">;
6615ffd83dbSDimitry Andric
6625ffd83dbSDimitry Andric// Ignore GCC collect2 LTO plugin related options. Note that we don't support
6635ffd83dbSDimitry Andric// GCC LTO, but GCC collect2 passes these options even in non-LTO mode.
6645ffd83dbSDimitry Andricdef: J<"plugin-opt=-fresolution=">;
6655ffd83dbSDimitry Andricdef: J<"plugin-opt=-pass-through=">;
6665ffd83dbSDimitry Andric// This may be either an unhandled LLVMgold.so feature or GCC passed
6675ffd83dbSDimitry Andric// -plugin-opt=path/to/{liblto_plugin.so,lto-wrapper}
6685ffd83dbSDimitry Andricdef plugin_opt_eq : J<"plugin-opt=">;
6690b57cec5SDimitry Andric
6700b57cec5SDimitry Andric// Options listed below are silently ignored for now for compatibility.
6710b57cec5SDimitry Andricdef: F<"detect-odr-violations">;
6720b57cec5SDimitry Andricdef: Flag<["-"], "g">;
6730b57cec5SDimitry Andricdef: F<"long-plt">;
6740b57cec5SDimitry Andricdef: F<"no-add-needed">;
6750b57cec5SDimitry Andricdef: F<"no-copy-dt-needed-entries">;
6760b57cec5SDimitry Andricdef: F<"no-ctors-in-init-array">;
6770b57cec5SDimitry Andricdef: F<"no-keep-memory">;
6780b57cec5SDimitry Andricdef: F<"no-pipeline-knowledge">;
6795ffd83dbSDimitry Andricdef: F<"no-relax">;
6800b57cec5SDimitry Andricdef: F<"no-warn-mismatch">;
6810b57cec5SDimitry Andricdef: Flag<["-"], "p">;
6820b57cec5SDimitry Andricdef: Separate<["--", "-"], "rpath-link">;
6830b57cec5SDimitry Andricdef: J<"rpath-link=">;
6840b57cec5SDimitry Andricdef: F<"secure-plt">;
6850b57cec5SDimitry Andricdef: F<"sort-common">;
6860b57cec5SDimitry Andricdef: F<"stats">;
6870b57cec5SDimitry Andricdef: F<"warn-execstack">;
6880b57cec5SDimitry Andricdef: F<"warn-once">;
6890b57cec5SDimitry Andricdef: F<"warn-shared-textrel">;
6900b57cec5SDimitry Andricdef: F<"EB">;
6910b57cec5SDimitry Andricdef: F<"EL">;
6920b57cec5SDimitry Andricdef: JoinedOrSeparate<["-"], "G">;
6930b57cec5SDimitry Andricdef: F<"Qy">;
6940b57cec5SDimitry Andric
6950b57cec5SDimitry Andric// Hidden option used for testing MIPS multi-GOT implementation.
6960b57cec5SDimitry Andricdefm mips_got_size:
6970b57cec5SDimitry Andric  Eq<"mips-got-size", "Max size of a single MIPS GOT. 0x10000 by default.">,
6980b57cec5SDimitry Andric  Flags<[HelpHidden]>;
699