[Gnu] Support an other form of defsym option

llvm-svn: 233782
This commit is contained in:
Shankar Easwaran 2015-04-01 03:06:59 +00:00
parent 0e90f3ff9a
commit ee39d33175
2 changed files with 17 additions and 3 deletions

View File

@ -25,6 +25,15 @@ multiclass dashEq<string opt1, string opt2, string help> {
Alias<!cast<Option>(opt1)>;
}
// Support --<option>,--<option>=
multiclass mDashEq<string opt1, string help> {
// Option
def "" : Separate<["--"], opt1>, HelpText<help>;
// Compatibility aliases
def opt2_eq : Joined<["--"], opt1#"=">,
Alias<!cast<Option>(opt1)>;
}
//===----------------------------------------------------------------------===//
/// LLVM and Target options
//===----------------------------------------------------------------------===//
@ -211,8 +220,10 @@ def use_shlib_undefs: Flag<["--"], "use-shlib-undefines">,
def allow_multiple_definition: Flag<["--"], "allow-multiple-definition">,
HelpText<"Allow multiple definitions">,
Group<grp_resolveropt>;
def defsym : Joined<["--"], "defsym=">,
HelpText<"Create a defined symbol">,
defm defsym : mDashEq<"defsym",
"Create a global symbol in the output file "
"containing the absolute address given by expression">,
MetaVarName<"symbol=<expression>">,
Group<grp_resolveropt>;
//===----------------------------------------------------------------------===//

View File

@ -4,6 +4,9 @@
# RUN: lld -flavor gnu -target x86_64 --defsym=foo=main -r %s \
# RUN: --output-filetype=yaml | FileCheck -check-prefix=ALIAS %s
# RUN: lld -flavor gnu -target x86_64 --defsym foo=main -r %s \
# RUN: --output-filetype=yaml | FileCheck -check-prefix=ALIAS %s
defined-atoms:
- name: main
scope: global