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


You are probably statically linking with the runtime libraries. Look at the
output of gcc -v. It will tell you how your gcc was configured. Do you see a
--disable-shared anywhere in the output? If so, you are statically linking
with the runtime libraries.

Doug.

-----Original Message-----
From: D.Venkatasubramanian, Noida [mailto:dvenkat@noida.hcltech.com]
Sent: Tuesday, September 24, 2002 06:15
To: Kazu Hirata
Cc: gcc@gcc.gnu.org; gcc-bugs@gcc.gnu.org
Subject: Huge executable file with gcc version 3.1.1


Hi,

I found that even very small test cases like an Hello World Program in C++, 
creating huge executable files for h8300-elf architecture.

If you see the output from the shell given below, 
you find that for a simple program, the executable was 2.9 MB.

I noticed this happening only when some header file was included.
This causes the simulator to crash, and when I compiled with -g option,
and tried to load it on the debugger, I found the debugger crashing when 
I tried to load the executable on the simulator.Seems the debugger crash 
must be due to this large size.

I noticed this when I found many test cases failing when I ran make check.

Any help would be appreciated.

Thanks and Regards,

Venky



[venkat@peacock BugC37]$ cat test.C
#include<iostream.h>
int main()
{
        std::cout << "Hello World" << endl;
}

[venkat@peacock BugC37]$ h8300-elf-g++ -v
Reading specs from
/home/venkat/gcc_release/h8300-elf/tools/bin/../lib/gcc-lib/h8300-elf/3.1.1/
specs
Configured with: /export/niting/WorkArea/gcc-release/src/configure
--prefix=/home/venkat/gcc_release/h8300-elf/tools/ --target=h8300-elf
--with-newlib --enable-languages=c,c++ --with-gnu-ld --with-gnu-as
--with-ld=/home/venkat/gcc_release/h8300-elf/tools/h8300-elf/bin/ld
--with-as=/home/venkat/gcc_release/h8300-elf/tools/h8300-elf/bin/as
--with-headers=/export/niting/WorkArea/gcc-release/src/newlib/libc/include/
Thread model: single
gcc version 3.1.1
[venkat@peacock BugC37]$ h8300-elf-g++ -mh -mint32 test.C
In file included from
/home/venkat/gcc_release/h8300-elf/tools/include/c++/3.1.1/backward/iostream
.h:31,
                 from test.C:1:
/home/venkat/gcc_release/h8300-elf/tools/include/c++/3.1.1/backward/backward
_warning.h:32:2: warning: #warning This file includes at least one
deprecated or antiquated header. Please consider using one of the 32 headers
found in section 17.4.1.2 of the C++ standard. Examples include substituting
the <X> header for the <X.h> header for C++ includes, or <sstream> instead
of the deprecated header <strstream.h>. To disable this warning use
-Wno-deprecated.
[venkat@peacock BugC37]$ du -sk -h a.out
2.9M    a.out
[venkat@peacock BugC37]$ file a.out
a.out: ELF 32-bit MSB executable, Hitachi H8/300H, version 1 (SYSV),
statically linked, not stripped
[venkat@peacock BugC37]$ ls -al
total 2908
drwxrwxr-x    2 venkat   venkat       4096 Sep 24 18:44 .
drwxrwxr-x   65 venkat   venkat       4096 Sep 24 17:37 ..
-rwxrwxr-x    1 venkat   venkat    2958101 Sep 24 18:44 a.out
-rw-rw-r--    1 venkat   venkat         74 Sep 24 18:42 test.C
[venkat@peacock BugC37]$


_____________________________________________________

"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]