[lld] r205391 - [ELF] Add -z muldefs option.
Shankar Easwaran
shankarke at gmail.com
Tue Apr 1 20:57:37 PDT 2014
Author: shankare
Date: Tue Apr 1 22:57:37 2014
New Revision: 205391
URL: http://llvm.org/viewvc/llvm-project?rev=205391&view=rev
Log:
[ELF] Add -z muldefs option.
This adds -z muldefs option which is widely used over
--allow-multiple-definition.
This option is supported by the GNU linker.
Modified:
lld/trunk/lib/Driver/GnuLdDriver.cpp
lld/trunk/test/elf/allowduplicates.objtxt
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=205391&r1=205390&r2=205391&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Tue Apr 1 22:57:37 2014
@@ -440,6 +440,16 @@ bool GnuLdDriver::parse(int argc, const
groupStack.pop();
break;
+ case OPT_z: {
+ StringRef extOpt = inputArg->getValue();
+ if (extOpt == "muldefs")
+ ctx->setAllowDuplicates(true);
+ else
+ diagnostics << "warning: ignoring unknown argument for -z: " << extOpt
+ << "\n";
+ break;
+ }
+
case OPT_INPUT:
case OPT_l: {
bool isDashlPrefix = (inputArg->getOption().getID() == OPT_l);
Modified: lld/trunk/test/elf/allowduplicates.objtxt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/allowduplicates.objtxt?rev=205391&r1=205390&r2=205391&view=diff
==============================================================================
--- lld/trunk/test/elf/allowduplicates.objtxt (original)
+++ lld/trunk/test/elf/allowduplicates.objtxt Tue Apr 1 22:57:37 2014
@@ -1,8 +1,11 @@
-# RUN: lld -flavor gnu -target x86_64 --allow-multiple-definition -r %s \
-# RUN: --output-filetype=yaml | FileCheck %s
+# RUN: lld -flavor gnu -target x86_64 --allow-multiple-definition %s \
+# RUN: --output-filetype=yaml --noinhibit-exec | FileCheck %s
#
-# RUN: not lld -flavor gnu -target x86_64 -r %s --output-filetype=yaml 2>&1 \
-# RUN: | FileCheck -check-prefix=ERROR %s
+# RUN: not lld -flavor gnu -target x86_64 %s --output-filetype=yaml \
+# RUN: --noinhibit-exec 2>&1 | FileCheck -check-prefix=ERROR %s
+#
+# RUN: lld -flavor gnu -target x86_64 -z muldefs %s \
+# RUN: --noinhibit-exec --output-filetype=yaml | FileCheck %s
---
defined-atoms:
More information about the llvm-commits
mailing list