<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 1, 2014 at 9:17 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On 4/1/2014 11:12 PM, Rui Ueyama wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Apr 1, 2014 at 8:57 PM, Shankar Easwaran <<a href="mailto:shankarke@gmail.com" target="_blank">shankarke@gmail.com</a>>wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: shankare<br>
Date: Tue Apr 1 22:57:37 2014<br>
New Revision: 205391<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=205391&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=205391&view=rev</a><br>
Log:<br>
[ELF] Add -z muldefs option.<br>
<br>
This adds -z muldefs option which is widely used over<br>
--allow-multiple-definition.<br>
<br>
This option is supported by the GNU linker.<br>
<br>
Modified:<br>
lld/trunk/lib/Driver/<u></u>GnuLdDriver.cpp<br>
lld/trunk/test/elf/<u></u>allowduplicates.objtxt<br>
<br>
Modified: lld/trunk/lib/Driver/<u></u>GnuLdDriver.cpp<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=205391&r1=205390&r2=205391&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/Driver/<u></u>GnuLdDriver.cpp?rev=205391&r1=<u></u>205390&r2=205391&view=diff</a><br>
<br>
==============================<u></u>==============================<u></u>==================<br>
--- lld/trunk/lib/Driver/<u></u>GnuLdDriver.cpp (original)<br>
+++ lld/trunk/lib/Driver/<u></u>GnuLdDriver.cpp Tue Apr 1 22:57:37 2014<br>
@@ -440,6 +440,16 @@ bool GnuLdDriver::parse(int argc, const<br>
groupStack.pop();<br>
break;<br>
<br>
+ case OPT_z: {<br>
+ StringRef extOpt = inputArg->getValue();<br>
+ if (extOpt == "muldefs")<br>
+ ctx->setAllowDuplicates(true);<br>
+ else<br>
+ diagnostics << "warning: ignoring unknown argument for -z: " <<<br>
extOpt<br>
+ << "\n";<br>
+ break;<br>
+ }<br>
+<br>
case OPT_INPUT:<br>
case OPT_l: {<br>
bool isDashlPrefix = (inputArg->getOption().getID() == OPT_l);<br>
<br>
Modified: lld/trunk/test/elf/<u></u>allowduplicates.objtxt<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/allowduplicates.objtxt?rev=205391&r1=205390&r2=205391&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/test/elf/<u></u>allowduplicates.objtxt?rev=<u></u>205391&r1=205390&r2=205391&<u></u>view=diff</a><br>
<br>
==============================<u></u>==============================<u></u>==================<br>
--- lld/trunk/test/elf/<u></u>allowduplicates.objtxt (original)<br>
+++ lld/trunk/test/elf/<u></u>allowduplicates.objtxt Tue Apr 1 22:57:37 2014<br>
@@ -1,8 +1,11 @@<br>
-# RUN: lld -flavor gnu -target x86_64 --allow-multiple-definition -r %s \<br>
-# RUN: --output-filetype=yaml | FileCheck %s<br>
+# RUN: lld -flavor gnu -target x86_64 --allow-multiple-definition %s \<br>
+# RUN: --output-filetype=yaml --noinhibit-exec | FileCheck %s<br>
#<br>
-# RUN: not lld -flavor gnu -target x86_64 -r %s --output-filetype=yaml<br>
2>&1 \<br>
-# RUN: | FileCheck -check-prefix=ERROR %s<br>
+# RUN: not lld -flavor gnu -target x86_64 %s --output-filetype=yaml \<br>
+# RUN: --noinhibit-exec 2>&1 | FileCheck -check-prefix=ERROR %s<br>
+#<br>
+# RUN: lld -flavor gnu -target x86_64 -z muldefs %s \<br>
+# RUN: --noinhibit-exec --output-filetype=yaml | FileCheck %s<br>
<br>
</blockquote>
Why do you now need --noinhibit-exec?<br>
</blockquote></div></div>
The testcase previously used -r, which is not supported (or) not implemented at this time.<br>
<br>
--noinhibit-exec tries to keep the executable even if there is an undefined symbol, which in this case corresponds to _start undefined.</blockquote><div><br></div><div>-r was intentional -- although ELF writer does not support writing it, YAML writer does. It was slightly better than --noinhibit-exec because it did not warn on unresolved symbols unlike --noinhibit-exec.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks<span><font color="#888888"><br>
<br>
Shankar Easwaran<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</font></span></blockquote></div><br></div></div>