<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 1, 2014 at 9:40 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:30 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 9:17 PM, Shankar Easwaran <<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>><u></u>wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 4/1/2014 11:12 PM, Rui Ueyama wrote:<br>
<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><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wrote:<br>
</blockquote>
Author: shankare<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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/" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/Driver/</a><br>
GnuLdDriver.cpp?rev=205391&r1=<u></u>205390&r2=205391&view=diff<br>
<br>
==============================<u></u>==============================<br>
==================<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/" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/test/elf/</a><br>
allowduplicates.objtxt?rev=<u></u>205391&r1=205390&r2=205391&<u></u>view=diff<br>
<br>
==============================<u></u>==============================<br>
==================<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>
\<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>
Why do you now need --noinhibit-exec?<br>
</blockquote></blockquote>
The testcase previously used -r, which is not supported (or) not<br>
implemented at this time.<br>
<br>
--noinhibit-exec tries to keep the executable even if there is an<br>
undefined symbol, which in this case corresponds to _start undefined.<br>
</blockquote>
<br>
-r was intentional -- although ELF writer does not support writing it, YAML<br>
writer does. It was slightly better than --noinhibit-exec because it did<br>
not warn on unresolved symbols unlike --noinhibit-exec.<br>
<br>
</blockquote>
<br></div></div>
You might already know, The -r option is not handled by YAML writer.<br>
<br>
The GnuLdDriver handles this and sets appropriate flags when -r option is seen in the LinkingContext, and nothing else is done with it, since you bypass the writer to the output yaml writer.<br>
<br>
With gnu, we consistently use --noinhibit-exec for all tests, and I would prefer to stay consistent with all tests.</blockquote><div><br></div><div>Well, that's not true because I learned the use of -r from other test files having .objtxt extension in the same directory.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
Thanks<br>
<br>
Shankar Easwaran<br>
-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
</div></div></blockquote></div><br></div></div>