This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc 4.1.1: char *p = "str" puts "str" into rodata
- From: Denis Vlasenko <vda dot linux at googlemail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 28 Jan 2007 16:57:07 +0100
- Subject: gcc 4.1.1: char *p = "str" puts "str" into rodata
char p;
int main() {
p = "";
return 0;
}
Don't you think that "" should end up in rw data?
/*
.file "t.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string ""
.text
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
movl $.LC0, %eax
movb %al, p
xorl %eax, %eax
leave
ret
.size main, .-main
.comm p,1,1
.ident "GCC: (GNU) 4.1.1"
.section .note.GNU-stack,"",@progbits
*/
--
vda