Uninitialized data on Darwin/MacOS (gcc 4.3)

markus.stuermer@freenet.de markus.stuermer@freenet.de
Tue May 20 12:10:00 GMT 2008


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














More information about the Gcc mailing list