diff options
-rw-r--r-- | lld/ELF/Driver.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/Options.td | 28 | ||||
-rw-r--r-- | lld/test/ELF/auxiliary.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/pack-dyn-relocs.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/sectionstart.s | 2 | ||||
-rw-r--r-- | lld/test/ELF/symbol-ordering-file.s | 2 |
6 files changed, 20 insertions, 18 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index f4883fe18b9..8abac814fee 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -772,7 +772,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) { std::tie(Config->BuildId, Config->BuildIdVector) = getBuildId(Args); - if (auto *Arg = Args.getLastArg(OPT_pack_dyn_relocs_eq)) { + if (auto *Arg = Args.getLastArg(OPT_pack_dyn_relocs)) { StringRef S = Arg->getValue(); if (S == "android") Config->AndroidPackDynRelocs = true; diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td index 4637289fa0c..b1c7a1d4046 100644 --- a/lld/ELF/Options.td +++ b/lld/ELF/Options.td @@ -4,7 +4,6 @@ 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 NAME: Separate<["--", "-"], name>; @@ -16,7 +15,8 @@ multiclass B<string name, string help1, string help2> { def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText<help2>; } -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">; @@ -67,7 +67,7 @@ defm as_needed: B<"as-needed", "Always set DT_NEEDED for shared libraries">; // -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">; @@ -94,7 +94,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">, @@ -227,7 +227,7 @@ def omagic: Flag<["--"], "omagic">, MetaVarName<"<magic>">, defm orphan_handling: Eq<"orphan-handling">, HelpText<"Control how orphan sections are handled when linker script used">; -def pack_dyn_relocs_eq: J<"pack-dyn-relocs=">, MetaVarName<"<format>">, +defm pack_dyn_relocs: Eq<"pack-dyn-relocs">, MetaVarName<"<format>">, HelpText<"Pack dynamic relocations in the given format (none or android)">; defm pie: B<"pie", @@ -258,7 +258,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">; @@ -275,7 +275,7 @@ def strip_all: F<"strip-all">, HelpText<"Strip all symbols">; 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">; @@ -350,12 +350,11 @@ def alias_define_common_dc: F<"dc">, Alias<define_common>; def alias_define_common_dp: F<"dp">, Alias<define_common>; def alias_discard_all_x: Flag<["-"], "x">, Alias<discard_all>; def alias_discard_locals_X: Flag<["-"], "X">, Alias<discard_locals>; -def alias_dynamic_linker_eq: J<"dynamic-linker=">, Alias<dynamic_linker>; def alias_emit_relocs: Flag<["-"], "q">, Alias<emit_relocs>; 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_no_pie_pic_executable: F<"no-pic-executable">, Alias<no_pie>; @@ -373,8 +372,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>; @@ -394,7 +393,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">, @@ -404,7 +403,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">; @@ -430,8 +429,7 @@ def no_ctors_in_init_array: F<"no-ctors-in-init-array">; def no_keep_memory: F<"no-keep-memory">; def no_mmap_output_file: F<"no-mmap-output-file">; 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">; diff --git a/lld/test/ELF/auxiliary.s b/lld/test/ELF/auxiliary.s index 18fbdf05f9e..86551e3e84b 100644 --- a/lld/test/ELF/auxiliary.s +++ b/lld/test/ELF/auxiliary.s @@ -2,6 +2,8 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: ld.lld %t.o -shared -f aaa --auxiliary bbb -o %t # RUN: llvm-readobj --dynamic-table %t | FileCheck %s +# RUN: ld.lld %t.o -shared -f aaa --auxiliary=bbb -o %t +# RUN: llvm-readobj --dynamic-table %t | FileCheck %s # CHECK: DynamicSection [ # CHECK-NEXT: Tag Type Name/Value diff --git a/lld/test/ELF/pack-dyn-relocs.s b/lld/test/ELF/pack-dyn-relocs.s index cb8674318ec..e79cac64f43 100644 --- a/lld/test/ELF/pack-dyn-relocs.s +++ b/lld/test/ELF/pack-dyn-relocs.s @@ -5,7 +5,7 @@ // RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.a32 // RUN: ld.lld -pie --pack-dyn-relocs=none %t.a32 %t.a32.so -o %t2.a32 // RUN: llvm-readobj -relocations %t2.a32 | FileCheck --check-prefix=UNPACKED32 %s -// RUN: ld.lld -pie --pack-dyn-relocs=android %t.a32 %t.a32.so -o %t3.a32 +// RUN: ld.lld -pie --pack-dyn-relocs android %t.a32 %t.a32.so -o %t3.a32 // RUN: llvm-readobj -s -dynamic-table %t3.a32 | FileCheck --check-prefix=PACKED32-HEADERS %s // RUN: llvm-readobj -relocations %t3.a32 | FileCheck --check-prefix=PACKED32 %s diff --git a/lld/test/ELF/sectionstart.s b/lld/test/ELF/sectionstart.s index 23574c14748..053d41dbb1c 100644 --- a/lld/test/ELF/sectionstart.s +++ b/lld/test/ELF/sectionstart.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: ld.lld %t.o --section-start .text=0x100000 \ -# RUN: --section-start .data=0x110000 --section-start .bss=0x200000 -o %t +# RUN: --section-start=.data=0x110000 --section-start .bss=0x200000 -o %t # RUN: llvm-objdump -section-headers %t | FileCheck %s # CHECK: Sections: diff --git a/lld/test/ELF/symbol-ordering-file.s b/lld/test/ELF/symbol-ordering-file.s index 177c22f2775..34d67701933 100644 --- a/lld/test/ELF/symbol-ordering-file.s +++ b/lld/test/ELF/symbol-ordering-file.s @@ -21,6 +21,8 @@ # RUN: ld.lld --symbol-ordering-file %t_order.txt %t.o -o %t2.out # RUN: llvm-objdump -s %t2.out| FileCheck %s --check-prefix=AFTER +# RUN: ld.lld --symbol-ordering-file=%t_order.txt %t.o -o %t2.out +# RUN: llvm-objdump -s %t2.out| FileCheck %s --check-prefix=AFTER # AFTER: Contents of section .foo: # AFTER-NEXT: 201000 44335566 2211 |