[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking surprise...

Christian Henz wrote:
> I compiled some SDL+OpenGL code with both gcc/linux and mingw. With 
> mingw, the stripped exe would be < 10KB, while the linux binary was 
> ~40KB (5K and 18K upx'ed). Since I want to port a 64K intro to linux, 
> this bothered me and I thought, maybe I'd better use glut than SDL.
> So i added -lglut to my linker switches just to see how much that would 
> add to the size of the binary... surpsisingly the resulting filesize was 
> only a fraction of the original one! How can this be?  

Probably one has been 'stripped' and the other has not.

'stripping' an exectuatble means removing it's symbol table and other
debug information.  It can easily shrink the size of an executable
by a factor of four.

Compiling with differing '-G' options will also make big differences.
---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1@airmail.net>    WorkEmail: <sjbaker@link.com>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net