[LLVMdev] RFC: Mangling Unnamed Global Values

Dan Gohman gohman at apple.com
Mon Nov 24 10:48:08 PST 2008


Can symbols with external linkage but no name be converted
to have internal linkage?  Would that solve the problem?

Dan

On Nov 23, 2008, at 2:15 AM, Bill Wendling wrote:

> Hi all,
>
> Right now the Mangler::getValueName() method will produce something
> like "__unnamed_1_37" for a global value that doesn't have a name.
> This is wrong for Objective-C where CFStrings will get these labels,
> thus preventing the linker from coalescing them.
>
> [/tmp]> nm -s __DATA __cfstring -m foo.o
> 00000000000244d0 (__DATA,__cfstring) non-external __unnamed_1_0
> 00000000000244b0 (__DATA,__cfstring) non-external __unnamed_1_1
> ...
>
> I think that prepending the PrivateGlobalPrefix to these names would
> be the way to go. My question is whether getValueName() should do the
> prepending or should the individual back-end do it? I think that
> getValueName() should do it so that it's consistent, but then the
> prefix needs to be passed in (as the mangler doesn't know about the
> TargetAsmInfo object).
>
> What do you think?
>
> -bw
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list