<div dir="ltr">On Fri, Aug 30, 2013 at 1:28 PM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Aug 30, 2013, at 11:28 AM, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
<br>
><br>
>  So as I wrote a mergeable symbol with internal linkage is a weird concept, as it's obscure whether it should really be merged with symbols in other object file (because it's mergeable) or shouldn't (because it's private)<br>


</div>It is not “inernal” or “private” (and lld does not use those terms).  It is scopeLinkageUnit (aka visibility hidden) which means it is seen by all atoms being linked but then becomes a local symbol in the final linked image.<br>


<div class="im"><br>
<br>
> . Also, isAlias is not really implemented at all except some stub function to return boolean value, so I don't have a scaffold to connect this "weak external" thing to, to try to see how it'll work with that.<br>


</div>Yes, but they both seem like the same feature, so they should be implemented using the same mechanism.<br>
<br>
ELF:  foo is weak alias to bar.  What that means is that if the linker finds a real definition for foo, the weak alias is ignored.  If no real definition for foo is found, the references to foo use bar instead.<br></blockquote>

<div><br></div><div>I'm not really an ELF expert (so correct me if I'm wrong), but is symbol aliasing an ELF feature that the linker actually have to care about? As far as I tested, the symbol alias is just a symbol pointing the same location as the original symbol; there's no data which symbol is alias and which is real. We even cannot distinguish alias from zero size atom. The current lld linker is able to handle symbol aliases. No special handling of alias is not needed.</div>

<div><br></div><div>I'd think we might want to remove isAlias() and symbol aliasing stuffs from lld if that was added to support ELF symbol aliasing which is not actually needed.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


COFF:  object file references foo with fallback of bar.  What that means is that if the linker finds a real definition of foo, the fallback is ignored.  If no real definition for foo is found, then the references to foo use bar instead.<br>


<br>
-Nick<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> Implementing the alias thing to support this COFF feature sounds like a bit too much to me.<br>
><br>
> <a href="http://llvm-reviews.chandlerc.com/D1550" target="_blank">http://llvm-reviews.chandlerc.com/D1550</a><br>
<br>
</div></div></blockquote></div><br></div></div>