<div dir="ltr">lgtm</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 13, 2014 at 10:11 AM, Rafael Espíndola <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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Aliases are just another name for a position in a file. As such, the<br>
regular symbol resolutions are not applied. For example,given<br>
<br>
define void @my_func() {<br>
  ret void<br>
}<br>
@my_alias = alias weak void ()* @my_func<br>
@my_alias2 = alias void ()* @my_alias<br>
<br>
We produce without this patch:<br>
<br>
        .weak   my_alias<br>
my_alias = my_func<br>
        .globl  my_alias2<br>
my_alias2 = my_alias<br>
<br>
That is, in the resulting ELF file my_alias, my_func and my_func2 are<br>
just 3 names pointing to offset 0 of .text. That is *not* the<br>
semantics of IR linking. For example, linking in a<br>
<br>
@my_alias = alias void ()* @other_func<br>
<br>
would require the strong my_alias to override the weak one and<br>
my_alias2 would end up pointing to other_func.<br>
<br>
There is no way to represent that with aliases being just another<br>
name, so the best solution seems to be to just disallow it, converting<br>
a miscompile into an error.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>