<div dir="ltr">I'm not sure if you understand the problem I'm trying to resolve.<div><br></div><div>IIUC, what <a href="https://bugs.llvm.org/show_bug.cgi?id=34301#c5" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=34301#c5</a> claims as a bug is not a bug.<br><div><br></div><div>Weak external symbols that were not compiled with -fPIC are fundamentally not representable when they are resolved to other DSOs. Assume that weak_func is provided by some DSO. As I wrote in the comment, simple code like</div><div><br></div><div>  if (weak_func)</div><div>    weak_fun();</div><div><br></div><div>doesn't work if the code is not compiled with -fPIC, because otherwise, weak_func has an address of its PLT entry which is always non-zero. As a result, if weak_func doesn't exist at runtime, it crashes when it executes weak_func(). That's bad, and my patch is to address the issue.</div></div><div><br></div><div>I don't know what else I need to explain, as I wrote all the reasoning of doing it as a comment in this patch. Which part of the comment is confusing to you?</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 1, 2017 at 6:42 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> writes:<br>
<br>
> No, I don't think this is related to PR34301. Why do you think so? This is<br>
> not also related to whether a symbol is a local or not.<br>
<br>
</span>I just tested the patch and it does break the test in<br>
<br>
<a href="https://bugs.llvm.org/show_bug.cgi?id=34301#c5" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug<wbr>.cgi?id=34301#c5</a><br>
<br>
As such, I don't think it should be applied.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div>