diff options
Diffstat (limited to 'contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td')
| -rw-r--r-- | contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td | 142 |
1 files changed, 41 insertions, 101 deletions
diff --git a/contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td b/contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td index 757d7e97958d..9e6b6f0005cd 100644 --- a/contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td +++ b/contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOpts.td @@ -1,37 +1,33 @@ -include "llvm/Option/OptParser.td" - -multiclass Eq<string name, string help> { - def NAME : Separate<["--"], name>; - def NAME #_eq : Joined<["--"], name #"=">, - Alias<!cast<Separate>(NAME)>, - HelpText<help>; -} - -def help : Flag<["--"], "help">; -def h : Flag<["-"], "h">, Alias<help>; - -def allow_broken_links - : Flag<["--"], "allow-broken-links">, - HelpText<"Allow llvm-objcopy to remove sections even if it would leave " - "invalid section references. The appropriate sh_link fields " - "will be set to zero.">; +include "CommonOpts.td" defm binary_architecture - : Eq<"binary-architecture", "Used when transforming an architecture-less " - "format (such as binary) to another format">; -def B : JoinedOrSeparate<["-"], "B">, Alias<binary_architecture>; + : Eq<"binary-architecture", "Ignored for compatibility">; +def B : JoinedOrSeparate<["-"], "B">, + Alias<binary_architecture>, + HelpText<"Alias for --binary-architecture">; defm target : Eq<"target", "Format of the input and output file">, Values<"binary">; -def F : JoinedOrSeparate<["-"], "F">, Alias<target>; +def F : JoinedOrSeparate<["-"], "F">, + Alias<target>, + HelpText<"Alias for --target">; defm input_target : Eq<"input-target", "Format of the input file">, Values<"binary">; -def I : JoinedOrSeparate<["-"], "I">, Alias<input_target>; +def I : JoinedOrSeparate<["-"], "I">, + Alias<input_target>, + HelpText<"Alias for --input-target">; defm output_target : Eq<"output-target", "Format of the output file">, Values<"binary">; -def O : JoinedOrSeparate<["-"], "O">, Alias<output_target>; +def O : JoinedOrSeparate<["-"], "O">, + Alias<output_target>, + HelpText<"Alias for --output-target">; + +defm new_symbol_visibility : Eq<"new-symbol-visibility", "Visibility of " + "symbols generated for binary input or added" + " with --add-symbol unless otherwise" + " specified. The default value is 'default'.">; def compress_debug_sections : Flag<["--"], "compress-debug-sections">; def compress_debug_sections_eq @@ -46,34 +42,10 @@ defm split_dwo "<dwo-file>, then strip-dwo on the input file">, MetaVarName<"dwo-file">; -def enable_deterministic_archives - : Flag<["--"], "enable-deterministic-archives">, - HelpText<"Enable deterministic mode when copying archives (use zero for " - "UIDs, GIDs, and timestamps).">; -def D : Flag<["-"], "D">, - Alias<enable_deterministic_archives>, - HelpText<"Alias for --enable-deterministic-archives">; - -def disable_deterministic_archives - : Flag<["--"], "disable-deterministic-archives">, - HelpText<"Disable deterministic mode when copying archives (use real " - "values for UIDs, GIDs, and timestamps).">; -def U : Flag<["-"], "U">, - Alias<disable_deterministic_archives>, - HelpText<"Alias for --disable-deterministic-archives">; - -def preserve_dates : Flag<["--"], "preserve-dates">, - HelpText<"Preserve access and modification timestamps">; -def p : Flag<["-"], "p">, Alias<preserve_dates>; - defm add_gnu_debuglink : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">, MetaVarName<"debug-file">; -defm remove_section : Eq<"remove-section", "Remove <section>">, - MetaVarName<"section">; -def R : JoinedOrSeparate<["-"], "R">, Alias<remove_section>; - defm rename_section : Eq<"rename-section", "Renames a section from old to new, optionally with specified flags. " @@ -93,16 +65,20 @@ defm redefine_symbols "symbols from many files.">, MetaVarName<"filename">; -defm keep_section : Eq<"keep-section", "Keep <section>">, - MetaVarName<"section">; defm only_section : Eq<"only-section", "Remove all but <section>">, MetaVarName<"section">; -def j : JoinedOrSeparate<["-"], "j">, Alias<only_section>; +def j : JoinedOrSeparate<["-"], "j">, + Alias<only_section>, + HelpText<"Alias for --only-section">; defm add_section : Eq<"add-section", "Make a section named <section> with the contents of <file>.">, MetaVarName<"section=file">; +defm set_section_alignment + : Eq<"set-section-alignment", "Set alignment for a given section.">, + MetaVarName<"section=align">; + defm set_section_flags : Eq<"set-section-flags", "Set section flags for a given section. Flags supported for GNU " @@ -110,27 +86,14 @@ defm set_section_flags "rom, share, contents, merge, strings.">, MetaVarName<"section=flag1[,flag2,...]">; -def strip_all : Flag<["--"], "strip-all">, - HelpText<"Remove non-allocated sections outside segments. " - ".gnu.warning* and .ARM.attribute sections are not " - "removed">; -def S : Flag<["-"], "S">, Alias<strip_all>; -def strip_all_gnu : Flag<["--"], "strip-all-gnu">, - HelpText<"Compatible with GNU objcopy's --strip-all">; -def strip_debug : Flag<["--"], "strip-debug">, - HelpText<"Remove all debug information">; -def g : Flag<["-"], "g">, Alias<strip_debug>, - HelpText<"Alias for --strip-debug">; +def S : Flag<["-"], "S">, + Alias<strip_all>, + HelpText<"Alias for --strip-all">; def strip_dwo : Flag<["--"], "strip-dwo">, HelpText<"Remove all DWARF .dwo sections from file">; -def strip_sections - : Flag<["--"], "strip-sections">, - HelpText<"Remove all section headers and all sections not in segments">; def strip_non_alloc : Flag<["--"], "strip-non-alloc">, HelpText<"Remove all non-allocated sections outside segments">; -def strip_unneeded : Flag<["--"], "strip-unneeded">, - HelpText<"Remove all symbols not needed by relocations">; defm strip_unneeded_symbol : Eq<"strip-unneeded-symbol", "Remove symbol <symbol> if it is not needed by relocations">, @@ -164,7 +127,9 @@ defm localize_symbols "Reads a list of symbols from <filename> and marks them local.">, MetaVarName<"filename">; -def L : JoinedOrSeparate<["-"], "L">, Alias<localize_symbol>; +def L : JoinedOrSeparate<["-"], "L">, + Alias<localize_symbol>, + HelpText<"Alias for --localize-symbol">; defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">, MetaVarName<"symbol">; @@ -179,7 +144,9 @@ defm keep_global_symbol "Convert all symbols except <symbol> to local. May be repeated to " "convert all except a set of symbols to local.">, MetaVarName<"symbol">; -def G : JoinedOrSeparate<["-"], "G">, Alias<keep_global_symbol>; +def G : JoinedOrSeparate<["-"], "G">, + Alias<keep_global_symbol>, + HelpText<"Alias for --keep-global-symbol">; defm keep_global_symbols : Eq<"keep-global-symbols", @@ -197,31 +164,17 @@ defm weaken_symbols "Reads a list of symbols from <filename> and marks them weak.">, MetaVarName<"filename">; -def W : JoinedOrSeparate<["-"], "W">, Alias<weaken_symbol>; +def W : JoinedOrSeparate<["-"], "W">, + Alias<weaken_symbol>, + HelpText<"Alias for --weaken-symbol">; def weaken : Flag<["--"], "weaken">, HelpText<"Mark all global symbols as weak">; -def discard_locals : Flag<["--"], "discard-locals">, - HelpText<"Remove compiler-generated local symbols, (e.g. " - "symbols starting with .L)">; -def X : Flag<["-"], "X">, Alias<discard_locals>; - -def discard_all - : Flag<["--"], "discard-all">, - HelpText<"Remove all local symbols except file and section symbols">; -def x : Flag<["-"], "x">, Alias<discard_all>; -defm strip_symbol : Eq<"strip-symbol", "Remove symbol <symbol>">, - MetaVarName<"symbol">; defm strip_symbols : Eq<"strip-symbols", "Reads a list of symbols from <filename> and removes them.">, MetaVarName<"filename">; -def N : JoinedOrSeparate<["-"], "N">, Alias<strip_symbol>; -defm keep_symbol : Eq<"keep-symbol", "Do not remove symbol <symbol>">, - MetaVarName<"symbol">; -def K : JoinedOrSeparate<["-"], "K">, Alias<keep_symbol>; - defm keep_symbols : Eq<"keep-symbols", "Reads a list of symbols from <filename> and runs as if " @@ -231,13 +184,6 @@ defm keep_symbols "be repeated to read symbols from many files.">, MetaVarName<"filename">; -def only_keep_debug - : Flag<["--"], "only-keep-debug">, - HelpText<"Clear sections that would not be stripped by --strip-debug. " - "Currently only implemented for COFF.">; - -def keep_file_symbols : Flag<["--"], "keep-file-symbols">, - HelpText<"Do not remove file symbols">; defm dump_section : Eq<"dump-section", "Dump contents of section named <section> into file <file>">, @@ -250,9 +196,6 @@ defm prefix_alloc_sections : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">, MetaVarName<"prefix">; -def version : Flag<["--"], "version">, - HelpText<"Print the version and exit.">; -def V : Flag<["-"], "V">, Alias<version>; defm build_id_link_dir : Eq<"build-id-link-dir", "Set directory for --build-id-link-input and " "--build-id-link-output to <dir>">, @@ -266,10 +209,6 @@ defm build_id_link_output "name derived from hex build ID">, MetaVarName<"suffix">; -def regex - : Flag<["--"], "regex">, - HelpText<"Permit regular expressions in name comparison">; - defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides " "any previous --change-start or --adjust-start values.">, MetaVarName<"addr">; @@ -278,11 +217,12 @@ defm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "cumulatively.">, MetaVarName<"incr">; def adjust_start : JoinedOrSeparate<["--"], "adjust-start">, - Alias<change_start>; + Alias<change_start>, + HelpText<"Alias for --change-start">; defm add_symbol : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: " - "global, local, weak, default, hidden, file, section, object, " + "global, local, weak, default, hidden, protected, file, section, object, " "function, indirect-function. Accepted but ignored for " "compatibility: debug, constructor, warning, indirect, synthetic, " "unique-object, before.">, |
