- Accept both `--foo bar` and `--foo=bar` styles options. - Add support for -z initfirst. - Generate __data_start symbol that marks the start of .data when __data_start is referenced from code being linked. From Brad (maintainer)
122 lines
5.4 KiB
Plaintext
122 lines
5.4 KiB
Plaintext
$OpenBSD: patch-tools_lld_ELF_Options_td,v 1.1 2018/10/25 09:25:38 ajacoutot Exp $
|
|
|
|
Accept both `--foo bar` and `--foo=bar` styles options.
|
|
|
|
GNU linkers by convention supports both `--foo bar` and `--foo=bar` styles
|
|
for all long options that take arguments.
|
|
|
|
Index: tools/lld/ELF/Options.td
|
|
--- tools/lld/ELF/Options.td.orig
|
|
+++ tools/lld/ELF/Options.td
|
|
@@ -4,14 +4,14 @@ include "llvm/Option/OptParser.td"
|
|
// two can precede the option name except those that start with 'o'.
|
|
class F<string name>: Flag<["--", "-"], name>;
|
|
class J<string name>: Joined<["--", "-"], name>;
|
|
-class S<string name>: Separate<["--", "-"], name>;
|
|
|
|
multiclass Eq<string name> {
|
|
def "": Separate<["--", "-"], name>;
|
|
def _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>;
|
|
}
|
|
|
|
-def auxiliary: S<"auxiliary">, HelpText<"Set DT_AUXILIARY field to the specified name">;
|
|
+defm auxiliary: Eq<"auxiliary">,
|
|
+ HelpText<"Set DT_AUXILIARY field to the specified name">;
|
|
|
|
def Bsymbolic: F<"Bsymbolic">, HelpText<"Bind defined symbols locally">;
|
|
|
|
@@ -52,7 +52,7 @@ def as_needed: F<"as-needed">,
|
|
HelpText<"Only set DT_NEEDED for shared libraries if used">;
|
|
|
|
// -chroot doesn't have a help text because it is an internal option.
|
|
-def chroot: S<"chroot">;
|
|
+defm chroot: Eq<"chroot">;
|
|
|
|
def color_diagnostics: F<"color-diagnostics">,
|
|
HelpText<"Use colors in diagnostics">;
|
|
@@ -76,7 +76,7 @@ def discard_locals: F<"discard-locals">,
|
|
def discard_none: F<"discard-none">,
|
|
HelpText<"Keep all symbols in the symbol table">;
|
|
|
|
-def dynamic_linker: S<"dynamic-linker">,
|
|
+defm dynamic_linker: Eq<"dynamic-linker">,
|
|
HelpText<"Which dynamic linker to use">;
|
|
|
|
defm dynamic_list: Eq<"dynamic-list">,
|
|
@@ -264,7 +264,7 @@ defm retain_symbols_file: Eq<"retain-symbols-file">,
|
|
|
|
defm script: Eq<"script">, HelpText<"Read linker script">;
|
|
|
|
-def section_start: S<"section-start">, MetaVarName<"<address>">,
|
|
+defm section_start: Eq<"section-start">, MetaVarName<"<address>">,
|
|
HelpText<"Set address of section">;
|
|
|
|
def shared: F<"shared">, HelpText<"Build a shared object">;
|
|
@@ -281,7 +281,7 @@ def strip_all: F<"strip-all">, HelpText<"Strip all sym
|
|
|
|
def strip_debug: F<"strip-debug">, HelpText<"Strip debugging information">;
|
|
|
|
-def symbol_ordering_file: S<"symbol-ordering-file">,
|
|
+defm symbol_ordering_file: Eq<"symbol-ordering-file">,
|
|
HelpText<"Layout sections in the order specified by symbol file">;
|
|
|
|
defm sysroot: Eq<"sysroot">, HelpText<"Set the system root">;
|
|
@@ -348,7 +348,7 @@ def alias_emit_relocs: Flag<["-"], "q">, Alias<emit_re
|
|
def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>;
|
|
def alias_export_dynamic_E: Flag<["-"], "E">, Alias<export_dynamic>;
|
|
def alias_filter: Separate<["-"], "F">, Alias<filter>;
|
|
-def alias_format_b: S<"b">, Alias<format>;
|
|
+def alias_format_b: Separate<["-"], "b">, Alias<format>;
|
|
def alias_library: JoinedOrSeparate<["-"], "l">, Alias<library>;
|
|
def alias_library_path: JoinedOrSeparate<["-"], "L">, Alias<library_path>;
|
|
def alias_omagic: Flag<["-"], "N">, Alias<omagic>;
|
|
@@ -365,8 +365,8 @@ def alias_strip_all: Flag<["-"], "s">, Alias<strip_all
|
|
def alias_strip_debug_S: Flag<["-"], "S">, Alias<strip_debug>;
|
|
def alias_trace: Flag<["-"], "t">, Alias<trace>;
|
|
def alias_trace_symbol_y : JoinedOrSeparate<["-"], "y">, Alias<trace_symbol>;
|
|
-def alias_Ttext_segment: S<"Ttext-segment">, Alias<Ttext>;
|
|
-def alias_Ttext_segment_eq: J<"Ttext-segment=">, Alias<Ttext>;
|
|
+def alias_Ttext_segment: Separate<["-", "--"], "Ttext-segment">, Alias<Ttext>;
|
|
+def alias_Ttext_segment_eq: Joined<["-", "--"], "Ttext-segment=">, Alias<Ttext>;
|
|
def alias_undefined_u: JoinedOrSeparate<["-"], "u">, Alias<undefined>;
|
|
def alias_version_V: Flag<["-"], "V">, Alias<version>;
|
|
|
|
@@ -386,7 +386,7 @@ def lto_newpm_passes: J<"lto-newpm-passes=">,
|
|
def lto_partitions: J<"lto-partitions=">,
|
|
HelpText<"Number of LTO codegen partitions">;
|
|
def disable_verify: F<"disable-verify">;
|
|
-def mllvm: S<"mllvm">;
|
|
+defm mllvm: Eq<"mllvm">;
|
|
def opt_remarks_filename: Separate<["--"], "opt-remarks-filename">,
|
|
HelpText<"YAML output file for optimization remarks">;
|
|
def opt_remarks_with_hotness: Flag<["--"], "opt-remarks-with-hotness">,
|
|
@@ -396,7 +396,7 @@ defm plugin_opt: Eq<"plugin-opt">,
|
|
def save_temps: F<"save-temps">;
|
|
def thinlto_cache_dir: J<"thinlto-cache-dir=">,
|
|
HelpText<"Path to ThinLTO cached object file directory">;
|
|
-def thinlto_cache_policy: S<"thinlto-cache-policy">,
|
|
+defm thinlto_cache_policy: Eq<"thinlto-cache-policy">,
|
|
HelpText<"Pruning policy for the ThinLTO cache">;
|
|
def thinlto_jobs: J<"thinlto-jobs=">, HelpText<"Number of ThinLTO jobs">;
|
|
|
|
@@ -407,8 +407,7 @@ def thinlto_jobs: J<"thinlto-jobs=">, HelpText<"Number
|
|
// just ignore the option on lld side as it's easier. In fact, the linker could
|
|
// be called 'ld' and understanding which linker is used would require parsing of
|
|
// --version output.
|
|
-def plugin: S<"plugin">;
|
|
-def plugin_eq: J<"plugin=">;
|
|
+defm plugin: Eq<"plugin">;
|
|
|
|
// Options listed below are silently ignored for now for compatibility.
|
|
def allow_shlib_undefined: F<"allow-shlib-undefined">;
|
|
@@ -424,8 +423,7 @@ def no_keep_memory: F<"no-keep-memory">;
|
|
def no_mmap_output_file: F<"no-mmap-output-file">;
|
|
def no_warn_common: F<"no-warn-common">;
|
|
def no_warn_mismatch: F<"no-warn-mismatch">;
|
|
-def rpath_link: S<"rpath-link">;
|
|
-def rpath_link_eq: J<"rpath-link=">;
|
|
+defm rpath_link: Eq<"rpath-link">;
|
|
def sort_common: F<"sort-common">;
|
|
def stats: F<"stats">;
|
|
def warn_execstack: F<"warn-execstack">;
|