This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Is there in GCC a way control who initialized data is handled?
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Alexander dot Grobman at motorola dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: 29 Apr 2004 21:06:29 -0400
- Subject: Re: Is there in GCC a way control who initialized data is handled?
- References: <4091A5FE.9050206@motorola.com>
Alexander Grobman <Alexander.Grobman@motorola.com> writes:
> We just recently switched to PowerPC gcc 3.3.2 from 3.1.1 and found
> that the way how the initialized data distributed into sections
> had been changed.
>
> In old version initialized variables went to ".sdata" section
> regardless the init value.
>
> The newest version puts variables, which initialized to zero, to
> ".sbss". which is empty in the executable, in assumption
> that the memory is cleaned before usage, while non-zero go to ".sdata".
>
> We did not want to initalize memory to speed up boot operation.
>
> Is there any way (a switch) to cause gcc to behave as the older version?
> This will allow to initalize only required memory ..
Try -fno-zero-initialized-in-bss.
Ian