[ELF] - Accept --defsym foo=value form.
authorGeorge Rimar <grimar@accesssoftek.com>
Fri, 5 May 2017 11:59:15 +0000 (11:59 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Fri, 5 May 2017 11:59:15 +0000 (11:59 +0000)
Previously we accepted --defsym=foo=value only.

Reported by Sean Silva.

llvm-svn: 302227

lld/ELF/Options.td
lld/test/ELF/defsym.s

index 8863912..65a0e72 100644 (file)
@@ -290,6 +290,7 @@ def alias_L__library_path: J<"library-path=">, Alias<L>;
 def alias_define_common_d: Flag<["-"], "d">, Alias<define_common>;
 def alias_define_common_dc: F<"dc">, Alias<define_common>;
 def alias_define_common_dp: F<"dp">, Alias<define_common>;
+def alias_defsym: S<"defsym">, Alias<defsym>;
 def alias_discard_all_x: Flag<["-"], "x">, Alias<discard_all>;
 def alias_discard_locals_X: Flag<["-"], "X">, Alias<discard_locals>;
 def alias_dynamic_list: J<"dynamic-list=">, Alias<dynamic_list>;
index cafc514..778180d 100644 (file)
@@ -4,6 +4,11 @@
 # RUN: llvm-readobj -t -s %t | FileCheck %s
 # RUN: llvm-objdump -d -print-imm-hex %t | FileCheck %s --check-prefix=USE
 
+## Check that we accept --defsym foo2=foo1 form.
+# RUN: ld.lld -o %t2 %t.o --defsym foo2=foo1
+# RUN: llvm-readobj -t -s %t2 | FileCheck %s
+# RUN: llvm-objdump -d -print-imm-hex %t2 | FileCheck %s --check-prefix=USE
+
 ## In compare with GNU linkers, symbol defined with --defsym does
 ## not get aliased name in symbol table:
 # CHECK:      Symbol {