[LLVMdev] RFC: -fwritable-strings Change

Bill Wendling isanbard at gmail.com
Mon Jan 26 16:07:33 PST 2009


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?

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/cac0a5c7/attachment.obj>


More information about the llvm-dev mailing list