about .rodata and constants

From: Kevin (kevin_at_hotmail.com)
Date: 03/26/05


Date: Sat, 26 Mar 2005 22:11:37 +0000

I see that unless I use -fwritable-strings, gcc puts my constants
such as "foo" in the section .rodata. I also see that whatever I
declare with the keyword const, gcc puts it in .rodata.

I observed this in GNU/Linux, FreeBSD and Solaris.

My question is: is this the way gcc does for all UNIX-like
systems? I believe the answer could be something like: all
systems which use ELF format (or some other standard).

Thanks for information on this.