Displaying 3 results from an estimated 3 matches for "___cfconstantstringclassreference".
Did you mean:
__cfconstantstringclassreference
2009 Jan 27
0
[LLVMdev] RFC: -fwritable-strings Change
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
2009 Jan 27
2
[LLVMdev] RFC: -fwritable-strings Change
...mple example:
[/tmp]> cat foo.m
#include <Foundation/Foundation.h>
void foo() {
NSLog(@"");
}
[/tmp]> /Developer/usr/bin/llvm-gcc-4.2 foo.m -arch x86_64 -Os -S
[/tmp]> cat foo.s
...
L_unnamed_cfstring_0: ## L_unnamed_cfstring_0
.quad ___CFConstantStringClassReference
.long 1992 ## 0x7C8
.space 4
.quad LC
.space 8
.const
.lcomm LC,1,0 ## LC
...
[/tmp]>
The bug is that LC1 should be a read-only zero byte in the cstring
section. The compiler is making this a r/w zero byte in t...
2009 Jan 27
4
[LLVMdev] RFC: -fwritable-strings Change
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