Ping. The clang side has been fixed.<br><br>On Wednesday, October 16, 2013, Rafael Espíndola  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A long time ago (before r97733) we used to model the weakref attribute<br>

by outputting a new declaration and a weak alias to it. This was<br>
fairly buggy and we now implement weakref directly in clang, with the<br>
same logic an assembler uses to implement .weakref (which is what gcc<br>
prints).<br>
<br>
One thing that was left from that old implementation is that we still<br>
have alias to declarations and they are a very different concept from<br>
alias to definitions.<br>
<br>
Alias to definitions are just another symbol pointing to the same<br>
position in the object file. For example, given<br>
<br>
@bar = alias void ()* @foo<br>
define void @foo() {<br>
  ret void<br>
}<br>
<br>
Both ELF end COFF just get two symbols (foo and bar or _foo and _bar)<br>
pointing to the same section and offset.<br>
<br>
Alias to declarations are a lot fuzzier. They are still considered<br>
definitions according to GlobalValue::isDeclaration(), but the IR<br>
<br>
@bar = alias void ()* @foo<br>
declare void @foo()<br>
<br>
produces an empty ELF file and COFF files with two undefined symbols,<br>
but no connection between them. There is no good answer, since neither<br>
COFF nor ELF have an alias directive to pass the connection down to<br>
the linker.<br>
<br>
The only possible use right now seems to be what we used to do for<br>
weakref. Given<br>
<br>
@bar = hidden alias void ()* @foo<br>
declare void @foo()<br>
define void @zed() {<br>
       call void @foo()<br>
       call void @bar()<br>
       ret void<br>
}<br>
<br>
llc with the pic relocation model will produce a R_X86_64_PLT32 and a<br>
R_X86_64_PC32, both pointing to foo. That is, the alias acts as an<br>
alternative declaration.<br>
<br>
The supported way of doing this is to have a proper declaration in the<br>
file using the symbol:<br>
<br>
declare hidden void @bar()<br>
declare void @foo()<br>
define void @zed() {<br>
       call void @foo()<br>
       call void @bar()<br>
       ret void<br>
}<br>
<br>
and an alias on the file defining foo:<br>
<br>
@bar = hidden alias void ()* @foo<br>
define void @foo() {<br>
       ret void<br>
}<br>
<br>
With all that in mind, the attached patch changes the verifier to<br>
reject aliases to declarations and updates that language reference.<br>
The patch also updates the testcases. They seem to be almost all from<br>
the old weakref implementation.<br>
<br>
The patch itself depends on the patch to fix pr17535 so that clang<br>
detects the error before hitting the verifier on invalid input, but<br>
can hopefully be reviewed in parallel.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote>