This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/25522] zero-initialized constants are place in .bss
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2005 19:46:28 -0000
- Subject: [Bug middle-end/25522] zero-initialized constants are place in .bss
- References: <bug-25522-700@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from joseph at codesourcery dot com 2005-12-21 19:46 -------
Subject: Re: zero-initialized constants are place in
.bss
On Wed, 21 Dec 2005, pinskia at gcc dot gnu dot org wrote:
> Actually no, they are placed in the common section because of ANSI C rules.
There is no such requirement.
> This is not a bug.
ELF supports having a read-only equivalent of .bss (type SHT_NOBITS,
attributes SHF_ALLOC without SHF_WRITE). We could allocate such a section
name for read-only zero-initialized data and use it on ELF systems. That
way the data is read-only but doesn't consume space in the executable
(presuming the rest of the toolchain handles this case OK).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25522