[Gnu] Support an other form of defsym option
llvm-svn: 233782
This commit is contained in:
parent
0e90f3ff9a
commit
ee39d33175
|
@ -25,6 +25,15 @@ multiclass dashEq<string opt1, string opt2, string help> {
|
||||||
Alias<!cast<Option>(opt1)>;
|
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
|
/// LLVM and Target options
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -211,9 +220,11 @@ def use_shlib_undefs: Flag<["--"], "use-shlib-undefines">,
|
||||||
def allow_multiple_definition: Flag<["--"], "allow-multiple-definition">,
|
def allow_multiple_definition: Flag<["--"], "allow-multiple-definition">,
|
||||||
HelpText<"Allow multiple definitions">,
|
HelpText<"Allow multiple definitions">,
|
||||||
Group<grp_resolveropt>;
|
Group<grp_resolveropt>;
|
||||||
def defsym : Joined<["--"], "defsym=">,
|
defm defsym : mDashEq<"defsym",
|
||||||
HelpText<"Create a defined symbol">,
|
"Create a global symbol in the output file "
|
||||||
Group<grp_resolveropt>;
|
"containing the absolute address given by expression">,
|
||||||
|
MetaVarName<"symbol=<expression>">,
|
||||||
|
Group<grp_resolveropt>;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
/// Custom Options
|
/// Custom Options
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
# RUN: lld -flavor gnu -target x86_64 --defsym=foo=main -r %s \
|
# RUN: lld -flavor gnu -target x86_64 --defsym=foo=main -r %s \
|
||||||
# RUN: --output-filetype=yaml | FileCheck -check-prefix=ALIAS %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:
|
defined-atoms:
|
||||||
- name: main
|
- name: main
|
||||||
scope: global
|
scope: global
|
||||||
|
|
Loading…
Reference in New Issue