[LLVMdev] RFC: -fwritable-strings Change
Dale Johannesen
dalej at apple.com
Mon Jan 26 16:45:13 PST 2009
On Jan 26, 2009, at 4:07 PMPST, Bill Wendling wrote:
> There is a problem with Objective-C code where a null string is placed
> in the wrong section. If we have this code:
>
> #include <Foundation/Foundation.h>
> void foo() {
> NSLog(@"");
> }
>
> The null string is defined like this:
>
> .const
> .lcomm LC,1,0 ## LC
>
> Causing our linker to go nuts, because it expects anonymous strings to
> be in the __cstring section. I came up with the attached patch, which
> places the string in the .cstring section.
>
> My GCC-fu isn't great. Could someone review this to see if I broke
> anything?
I don't see anything obvious wrong, but this is an easy area to break.
I'd recommend running the gcc testsuite and checking for regressions.
Are you sure the problem is limited to CFStrings? That seems like the
wrong
thing to be checking somehow.
> Thanks!
> -bw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cfstring.diff
Type: application/octet-stream
Size: 2803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090126/11989ac1/attachment.obj>
-------------- next part --------------
> _______________________________________________
> 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