[lld] r310757 - Add `-z muldefs` option.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 11 13:49:48 PDT 2017
Author: ruiu
Date: Fri Aug 11 13:49:48 2017
New Revision: 310757
URL: http://llvm.org/viewvc/llvm-project?rev=310757&view=rev
Log:
Add `-z muldefs` option.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/allow-multiple-definition.s
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=310757&r1=310756&r2=310757&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Fri Aug 11 13:49:48 2017
@@ -613,7 +613,8 @@ static bool getCompressDebugSections(opt
// 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);
Modified: lld/trunk/test/ELF/allow-multiple-definition.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/allow-multiple-definition.s?rev=310757&r1=310756&r2=310757&view=diff
==============================================================================
--- lld/trunk/test/ELF/allow-multiple-definition.s (original)
+++ lld/trunk/test/ELF/allow-multiple-definition.s Fri Aug 11 13:49:48 2017
@@ -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.
More information about the llvm-commits
mailing list