Add `-z muldefs` option.

llvm-svn: 310757
This commit is contained in:
Rui Ueyama 2017-08-11 20:49:48 +00:00
parent b8956a70d3
commit be7e001369
2 changed files with 7 additions and 1 deletions

View File

@ -613,7 +613,8 @@ static bool getCompressDebugSections(opt::InputArgList &Args) {
// Initializes Config members by the command line options.
void LinkerDriver::readConfigs(opt::InputArgList &Args) {
Config->AllowMultipleDefinition = Args.hasArg(OPT_allow_multiple_definition);
Config->AllowMultipleDefinition =
Args.hasArg(OPT_allow_multiple_definition) || hasZOption(Args, "muldefs");
Config->AuxiliaryList = getArgs(Args, OPT_auxiliary);
Config->Bsymbolic = Args.hasArg(OPT_Bsymbolic);
Config->BsymbolicFunctions = Args.hasArg(OPT_Bsymbolic_functions);

View File

@ -8,6 +8,11 @@
# RUN: llvm-objdump -d %t3 | FileCheck %s
# RUN: llvm-objdump -d %t4 | FileCheck -check-prefix=REVERT %s
# RUN: ld.lld -z muldefs %t1 %t2 -o %t3
# RUN: ld.lld -z muldefs %t2 %t1 -o %t4
# RUN: llvm-objdump -d %t3 | FileCheck %s
# RUN: llvm-objdump -d %t4 | FileCheck -check-prefix=REVERT %s
# inputs contain different constants for instuction movl.
# Tests below checks that order of files in command line
# affects on what symbol will be used.