Index: ELF/Driver.cpp =================================================================== --- ELF/Driver.cpp +++ ELF/Driver.cpp @@ -772,7 +772,7 @@ 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; Index: ELF/Options.td =================================================================== --- ELF/Options.td +++ ELF/Options.td @@ -4,7 +4,6 @@ // two can precede the option name except those that start with 'o'. class F: Flag<["--", "-"], name>; class J: Joined<["--", "-"], name>; -class S: Separate<["--", "-"], name>; multiclass Eq { def NAME: Separate<["--", "-"], name>; @@ -16,7 +15,8 @@ def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText; } -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 @@ "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_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 @@ 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<"">, +defm pack_dyn_relocs: Eq<"pack-dyn-relocs">, MetaVarName<"">, HelpText<"Pack dynamic relocations in the given format (none or android)">; defm pie: B<"pie", @@ -258,7 +258,7 @@ defm script: Eq<"script">, HelpText<"Read linker script">; -def section_start: S<"section-start">, MetaVarName<"
">, +defm section_start: Eq<"section-start">, MetaVarName<"
">, HelpText<"Set address of section">; def shared: F<"shared">, HelpText<"Build a shared object">; @@ -275,7 +275,7 @@ 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_dp: F<"dp">, Alias; def alias_discard_all_x: Flag<["-"], "x">, Alias; def alias_discard_locals_X: Flag<["-"], "X">, Alias; -def alias_dynamic_linker_eq: J<"dynamic-linker=">, Alias; def alias_emit_relocs: Flag<["-"], "q">, Alias; def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias; def alias_export_dynamic_E: Flag<["-"], "E">, Alias; def alias_filter: Separate<["-"], "F">, Alias; -def alias_format_b: S<"b">, Alias; +def alias_format_b: Separate<["-"], "b">, Alias; def alias_library: JoinedOrSeparate<["-"], "l">, Alias; def alias_library_path: JoinedOrSeparate<["-"], "L">, Alias; def alias_no_pie_pic_executable: F<"no-pic-executable">, Alias; @@ -373,8 +372,8 @@ def alias_strip_debug_S: Flag<["-"], "S">, Alias; def alias_trace: Flag<["-"], "t">, Alias; def alias_trace_symbol_y : JoinedOrSeparate<["-"], "y">, Alias; -def alias_Ttext_segment: S<"Ttext-segment">, Alias; -def alias_Ttext_segment_eq: J<"Ttext-segment=">, Alias; +def alias_Ttext_segment: Separate<["-", "--"], "Ttext-segment">, Alias; +def alias_Ttext_segment_eq: Joined<["-", "--"], "Ttext-segment=">, Alias; def alias_undefined_u: JoinedOrSeparate<["-"], "u">, Alias; def alias_version_V: Flag<["-"], "V">, Alias; @@ -394,7 +393,7 @@ 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 @@ 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_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">; Index: test/ELF/auxiliary.s =================================================================== --- test/ELF/auxiliary.s +++ 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 Index: test/ELF/pack-dyn-relocs.s =================================================================== --- test/ELF/pack-dyn-relocs.s +++ 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 Index: test/ELF/sectionstart.s =================================================================== --- test/ELF/sectionstart.s +++ 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: Index: test/ELF/symbol-ordering-file.s =================================================================== --- test/ELF/symbol-ordering-file.s +++ 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