Rafael, The “weak-def” part is being lost. That means the linker cannot coalesce the copies.
-Nick On Mar 6, 2014, at 9:21 AM, jahanian <[email protected]> wrote: > There is functional change. > In the test case: > > @interface NSObject @end > > @protocol P0; > > @interface A : NSObject <P0> > +(Class) getClass; > @end > > @implementation A > +(Class) getClass { return self; } > @end > > int main() { > Protocol *P0 = @protocol(P0); > return 0; > } > > Before the change: > nm -nm t.o | grep PROTOCOL > 0000000000000078 (__DATA,__objc_const) non-external l_OBJC_CLASS_PROTOCOLS_$_A > 0000000000000120 (__DATA,__datacoal_nt) weak private external [no dead strip] > l_OBJC_PROTOCOL_$_P0 > 00000000000001c0 (__DATA,__objc_protolist) weak private external [no dead > strip] l_OBJC_LABEL_PROTOCOL_$_P0 > 00000000000001c8 (__DATA,__objc_protorefs) weak private external [no dead > strip] l_OBJC_PROTOCOL_REFERENCE_$_P0 > > With current TOT clang: > > nm -nm t.o | grep PROTOCOL > 0000000000000078 (__DATA,__objc_const) non-external l_OBJC_CLASS_PROTOCOLS_$_A > 0000000000000120 (__DATA,__datacoal_nt) non-external l_OBJC_PROTOCOL_$_P0 > 00000000000001c0 (__DATA,__objc_protolist) non-external > l_OBJC_LABEL_PROTOCOL_$_P0 > 00000000000001c8 (__DATA,__objc_protorefs) non-external > l_OBJC_PROTOCOL_REFERENCE_$_P0 > > - Fariborz > > On Mar 6, 2014, at 8:42 AM, Rafael Espíndola <[email protected]> > wrote: > >>> This is changing the linkage. Can you add comment why changing this will >>> not change visibility of the symbol. >>> Also, please add a test for this change. >> >> Sorry, I should have been more clear in the commit message. There is >> no functionality change. We just set the linkage at construction time >> instead of setting it afterwards with setLinkage. >> >> Cheers, >> Rafael > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
