r203052 - Construct GlobalValues with the correct linkage instead of using setLinkage.

Nick Kledzik kledzik at apple.com
Fri Sep 12 13:49:40 PDT 2014


On Sep 12, 2014, at 1:28 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:

>> I think you are confused by all the meanings of “weak”.   You are thinking of a weak_import which can be missing at runtime.
> 
> Well, I was unsure which one was desired in this case.
> 
>> ObjC only uses weak-definitions which are definitions that are automatically coalesced.
>> 
>> ld64 does support weak-def ‘l’ symbols.  Their atoms are coalesced by name, then the name is removed in the final output.  ObjC uses this for some data structures where the ‘l’ name has the user class/protocol name embedded in it.  It is used to reduce duplication of data structures.
> 
> Cool, fixed in r217704.
> 
> BTW, is there a difference between an 'l' symbol and one with hidden
> visibility (.private_extern)?

Usually ‘l’ symbols are static (file scoped). They are just there to break up a section into atoms.  

Sometimes they are private_extern if you want to coalesce them during the link, as you saw with the objc (weak_def) symbols.

-Nick





More information about the cfe-commits mailing list