Mail Archives: djgpp/2002/03/05/07:22:38
On Tue, 5 Mar 2002, Traveler wrote:
> -g 777 KB
> -gstabs+ 855 KB
> -ggdb3 914 KB
>
> > What happens if you run `strip' on the program?
>
> Running "strip --strip-unneeded hello.exe" helps. That monstrous "hello.exe"
> drops from 730 KB (with optimization's and without debugging info) to 234
> KB.
230KB is about right for GCC 3.x. The rest (the stuff stripped by
`strip') is debug and symbolic info that is never loaded into memory when
the program runs, it is only there for when you need to debug the
program, or symify the crash traceback.
> However, it's still quite large for the simplest possible C++ program...
Welcome to C++, a monstrously large language, where even to say hello you
need a lot of baggage. If that bothers you (I don't think it should),
don't use C++.
> I can understand that there maybe is some extra code to prepare DJGPP
> generated programs to run in 32-bit mode in an environment that has allways
> been 16-bit (DOS).
This has nothing to do with 32-bit vs 16-bit programs. It has everything
to do with the bloat in C++ classes used to print formatted messages.
The fact that C programs, which also run in 32-bit protected mode, are so
much smaller is the proof of this simple fact.
- Raw text -