This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Huge obj file size with GCC3.2!


Olivier Langlois writes:
 > Hi,
 > 
 > In one of my cpp file, I have to following variable declaration:
 > 
 > #define FONT_DATASIZE	(3 * 1024 * 1024)
 > u_long128		g_font_cache[FONT_DATASIZE];
 > 
 > and according to objdump, the compiler is reserving close to 50MB in the
 > obj .data section for this array:
 > 
 > 00000300 g     O .data	03000000 g_font_cache
 > 
 > The weird thing is that I have access to 2 other compilers and the 2
 > other compilers will generate a 12KB obj file for the same TU! They seem
 > to handle array storage differently as objdump shows:
 > 
 > 00000010 g     O .sdata	00000004 g_font_data
 > 
 > Is there a way, an optimization switch or anything that I can do to get
 > the same result from GCC?

gcc would normally put this in BSS, which wouldn't occupy space in the
object file, but this is somewhat system-dependent.  However, you'vre
given us no idea about your OS/Architecture, so we can't help you.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]