Subject: gcc question
To: None <netbsd-users@netbsd.org>
From: Wojciech Puchar <wojtek@chylonia.3miasto.net>
List: netbsd-users
Date: 04/17/2002 07:41:35
why when compiling (gcc -c) such code

const char* x[5]={"aaa","bbb","cseqweqwe","eeeeeeeee","fwerjkwelrjwe"};

i get non-zero .data segment in .o file?

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000000  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000014  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  2 .bss          00000000  00000000  00000000  00000048  2**2
                  ALLOC
  3 .note         00000014  00000000  00000000  00000048  2**0
                  CONTENTS, READONLY
  4 .rodata       0000002a  00000000  00000000  0000005c  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

or simply - why "const" doesn't but data in .rodata?!




--------------------------------------
http://www.3miasto.net/~wojtek/pgp.txt