<br><br>On Wednesday, June 4, 2014, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> Not sure I follow. Given<br>
><br>
<br>
Never mind, looking a bit closer at what ELF linkers do it seems they<br>
have just enough flexibility to handle this. There is a bit of<br>
documentation in<br>
<a href="http://www.sco.com/developers/gabi/latest/ch4.sheader.html" target="_blank">http://www.sco.com/developers/gabi/latest/ch4.sheader.html</a>. The gist<br>
seems to be:<br>
<br>
* for local symbols all references must be from withing the comdat.<br>
Not an issue since if the variable is local we don't put it in a<br>
comdat.<br>
* for global symbols the symbol is effectively made undefined if it<br>
pointed to a discarded section and linking continues. In particular,<br>
if the symbol is found in another comdat there is no error.<br>
<br>
This explains why the situation with variables is different from the<br>
situation with constructors:<br>
<br>
* With variables, if the new comdat with both var and guard is<br>
discarded, the other file is sure to have a comdat with the var and<br>
another with the guard.<br>
* With constructors, if the new comdat with C1 and C2 is discarded,<br>
the other file might have only C1 or C2.<br>
<br>
as for my earlier example in assembly, it was just missing a few<br>
.global directives :-)<br>
<br>
Now we "just" need to implement comdats in the IR!</blockquote><div><br></div><div>Just three more test cases to fix. :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Cheers,<br>
Rafael<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'llvm-commits@cs.uiuc.edu')">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote>