[PATCH] Add a fallback mechanism for undefined atom.

Nick Kledzik kledzik at apple.com
Tue Sep 3 12:59:17 PDT 2013


On Sep 3, 2013, at 12:51 PM, Shankar Easwaran <shankare at codeaurora.org> wrote:

> On 9/3/2013 2:36 PM, Nick Kledzik wrote:
>> On Sep 3, 2013, at 11:06 AM, Rui Ueyama <ruiu at google.com> wrote:
>>> Nick, does Mach-O need symbol aliasing to be handled in the linker?
>> Yes.  The darwin linker has command line options for adding aliases.
>> 
>> Back when I first started working on the darwin linker, a big complaint from the compiler team was that mach-o did not support aliases like ELF did, so the compiler team kept having to special case lots of test cases and functionality that used __attribute__((alias(“xx”))) on darwin.
>> 
>> 
> looks like ELF also needs the same functionality for implementing __wrap.
> 
> But in the case of the linker dealing with compiled .o's, the alias information is lost.
Really?  I thought ELF had a way to encode this.   I’ve received bug reports saying that mach-o should support it too.

> 
> Does Darwin keep the alias information when the __attribute__((alias(“xx”)) is used.
What the current darwin linker does is if parses a .o file and there are two symbols at the same address (and same section), it picks one to be the atom name (call it “foo”) and the other (call it “bar”) is turned into an alias atom (zero size and atom foo must layout after atom bar).

-Nick






More information about the llvm-commits mailing list