From bb451903f5a51fd7f49c9d298376315236e94ede Mon Sep 17 00:00:00 2001 From: George Rimar Date: Fri, 5 May 2017 11:59:15 +0000 Subject: [PATCH] [ELF] - Accept --defsym foo=value form. Previously we accepted --defsym=foo=value only. Reported by Sean Silva. llvm-svn: 302227 --- lld/ELF/Options.td | 1 + lld/test/ELF/defsym.s | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td index 8863912c179c..65a0e72d2320 100644 --- a/lld/ELF/Options.td +++ b/lld/ELF/Options.td @@ -290,6 +290,7 @@ def alias_L__library_path: J<"library-path=">, Alias; def alias_define_common_d: Flag<["-"], "d">, Alias; def alias_define_common_dc: F<"dc">, Alias; def alias_define_common_dp: F<"dp">, Alias; +def alias_defsym: S<"defsym">, Alias; def alias_discard_all_x: Flag<["-"], "x">, Alias; def alias_discard_locals_X: Flag<["-"], "X">, Alias; def alias_dynamic_list: J<"dynamic-list=">, Alias; diff --git a/lld/test/ELF/defsym.s b/lld/test/ELF/defsym.s index cafc5142d1a9..778180dc9324 100644 --- a/lld/test/ELF/defsym.s +++ b/lld/test/ELF/defsym.s @@ -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 {