Path: chuka.playstation.co.uk!news From: gil@snsys.com (Gil Jaysmith) Newsgroups: scea.yaroze.programming.gnu_compiler,scea.yaroze.programming.libraries,scee.yaroze.programming.gnu_compiler,scee.yaroze.programming.libraries Subject: Re: Real executable size Date: Mon, 16 Feb 1998 13:19:44 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 30 Message-ID: <34e83970.7648869@www-s.playstation.co.uk> References: <6c1nrg$bej17@chuka.playstation.co.uk> NNTP-Posting-Host: trish.snsys.com X-Newsreader: Forte Free Agent 1.11/32.235 Xref: chuka.playstation.co.uk scea.yaroze.programming.gnu_compiler:62 scea.yaroze.programming.libraries:13 scee.yaroze.programming.gnu_compiler:166 scee.yaroze.programming.libraries:110 On Fri, 13 Feb 1998 16:17:32 +0100, "Maurice Sibrandi" wrote: >When compiled my exe is about 20k (for example) but >when I declare an array of 250k (for a gpu workspace) the >size stays 20k. I wouldn't complain about it because it >saves upload time, but I'm writing my own siocons and >want to include a memory map. How can I see how big >my exe is INCLUDING the static data? Which registers >tell me that in the fileheaders? The array is most likely in the .bss section, and is allocated only when the program is loaded; there's no point storing 250K of zero-bytes in the image. The allocation size of each section is specified in the COFF section header table. You should be able to get an idea of total program size by adding up the section sizes displayed by 'objdump' (if a copy ships with the Yaroze tools - if not then I've got the Cygnus one lying around which should work). Alternatively you can get lots of fun information by adding "-Wl,-Map=map" to the gcc command line. The file 'map' receives an excessive amount of information showing where each symbol has ended up, and towards the end there's a list of final output sections. It's not exactly pretty, though it seems reasonably parseable if you're into that kind of thing. I'll take a look at the PS-EXE format to see what it specifically contains, but it isn't one we normally have to care about, so I don't really know right now. - Gil