This is the mail archive of the 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 executable file with gcc version 3.1.1


Yep, that was my concern. Such huge executables, almost totally put C++
out of scope for embedded applications, unless, I do not use libraries
(probably, certain libraries).

I could definitely have used C for this test case, but what about cases, 
where we would like to use C++ features and libraries.

A stripped C Hello World, was just 36 KB in comparison to 268 KB. Problem
with my configuration, h8300-elf and newlib, it only creates statically
linked executables. And my simulator promptly crashed for this Hello World
C++ Program :-(

Thanks for the help!



-----Original Message-----
From: Douglas Richardson []
Sent: Tuesday, September 24, 2002 8:49 PM
To: D.Venkatasubramanian, Noida; Douglas Richardson; Kazu Hirata
Subject: RE: Huge executable file with gcc version 3.1.1

You're right, it does seem large.

I have gcc configured on a Sun sparc to statically link and I tried out your
test program. After I stripped a.out it was still about 190k. A "Hello,
World" C program was only about 3k after I stripped it.

I also tried compiling the C++ program with different optimizations (-Os,
-O2, -O) but they did not effect the size of a.out.

I then compiled a C++ "Hello, World" program including stdio.h instead of
iostream and using printf instead of cout and the program was about the same
size as the C "Hello, World" program.

I then stripped libstdc++.a and tried to compile your "Hello, World"
program. I got undefined references to some initialization routines (like
std::ios_base::Init::Init()). The Standard Template Library is bringing in a
lot of extra code. That must be why your file is so large.

Even with that explanation, your a.out still seems very large.

Douglas Richardson.


"To be or not to be?" is not the question, but "What do you
want to be?" is.  
   --- Anon

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