This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Uninitialized data on Darwin/MacOS (gcc 4.3)
- From: markus dot stuermer at freenet dot de
- To: gcc at gcc dot gnu dot org
- Date: Tue, 20 May 2008 13:57:24 +0200
- Subject: Uninitialized data on Darwin/MacOS (gcc 4.3)
I noticed that GCC 4.3 seems to put unitialized data like predefined one into the data segment, leading to unnecessarily huge object files and binaries. The GCC 4.01 bundled with MacOS 10.5 seems to handle it in a better way.
GCC 4.3 stores uninitialized data as "(__DATA,__data) external", while 4.01 uses "(__DATA,__common) external".
Using "-fconserve-space" seems to be the only workaround for GCC 4.3 on Darwin at the moment (storing as "(common) (alignment 2^5) external").
I'm more used to the ELF format, but from what I've found on the web the Mach-0 file format should be well able of defining BSS type data.
Is there a configuration switch or compiler flag I overlooked? Should this behavior be regarded as a bug and be reported?
Regards, Markus