[PATCH] Add a fallback mechanism for undefined atom.
Nick Kledzik
kledzik at apple.com
Fri Aug 30 13:28:15 PDT 2013
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.
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
More information about the llvm-commits
mailing list