[PATCH] Add a fallback mechanism for undefined atom.

Rui Ueyama ruiu at google.com
Fri Aug 30 19:59:58 PDT 2013


On Fri, Aug 30, 2013 at 1:28 PM, Nick Kledzik <kledzik at apple.com> wrote:

>
> On Aug 30, 2013, at 11:28 AM, Rui Ueyama <ruiu at google.com> wrote:
>
> >
> >  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)
> 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.
>
>
> > . 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.
> Yes, but they both seem like the same feature, so they should be
> implemented using the same mechanism.
>
> 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.
>

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.

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.

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.
>
> -Nick
>
>
>
> > Implementing the alias thing to support this COFF feature sounds like a
> bit too much to me.
> >
> > http://llvm-reviews.chandlerc.com/D1550
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130830/d62d399f/attachment.html>


More information about the llvm-commits mailing list