r199709 - Use private linkage for utf-16 objc strings too.

Rafael Espíndola rafael.espindola at gmail.com
Wed Feb 26 05:35:02 PST 2014


On 25 February 2014 19:30, Bob Wilson <bob.wilson at apple.com> wrote:
> Rafael, this change is causing problems. Apple’s linker needs to see labels in the __ustring sections, and with this change, the ustring labels are local to the assembler and never seen at link-time. Please revert this. We can investigate getting the linker to relax that constraint in the future, but it doesn’t work now.

That is not the case. Since r201700 llvm knows the needs of the
linker. For example, given

@private2 = private unnamed_addr constant [5 x i16] [i16 116, i16 101,
                                                     i16 115, i16 116, i16 0]


llc will print

.section __TEXT,__text,regular,pure_instructions
.section __TEXT,__ustring
.align 1                       ## @private2
l_private2:
.short 116                     ## 0x74
.short 101                     ## 0x65
.short 115                     ## 0x73
.short 116                     ## 0x74
.short 0                       ## 0x0

note that a lowercase 'l' is used, so the symbol *is* visible to the linker.

Cheers,
Rafael




More information about the cfe-commits mailing list