junk

Joe Keane jgk@jgk.org
Tue Apr 28 13:24:00 GMT 1998


My C program is getting bigger.  

A while ago it got constructors and destructors.  Now it has exception
handling too.  I'm sure these are a very wonderful features that fix all
problems known to man, but keep in mind i'm just a stupid C programmer.

I now have a kilobyte of *data* in my program.  I don't understand this.

bash$ uname -a
Linux rocky 2.0.32 #1 Wed Nov 19 00:46:45 EST 1997 i586 unknown
bash$ cat true.c
int main(int argc, char **argv)
{
    return 0;
}
bash$ /usr/bin/gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/specs
gcc version 2.7.2.3
bash$ /usr/bin/gcc -o true true.c
bash$ size true
   text	   data	    bss	    dec	    hex	filename
    965	    192	      4	   1161	    489	true
bash$ nm --size-sort true
00000004 ? __CTOR_END__
00000004 ? __CTOR_LIST__
00000004 ? __DTOR_END__
00000004 ? __DTOR_LIST__
00000004 W _environ
00000004 W data_start
00000008 t fini_dummy
00000008 t init_dummy
0000000c T main
0000001c ? _fini
00000028 t __do_global_ctors_aux
00000028 t __do_global_dtors_aux
0000002c ? _init
00000044 T _start
bash$ /usr/local/bin/gcc -v
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
bash$ /usr/local/bin/gcc -o true true.c
bash$ size true
   text	   data	    bss	    dec	    hex	filename
   3963	   1040	     32	   5035	   13ab	true
bash$ nm --size-sort true
00000004 ? __CTOR_END__
00000004 ? __CTOR_LIST__
00000004 ? __DTOR_END__
00000004 ? __DTOR_LIST__
00000004 ? __FRAME_END__
00000004 W _environ
00000004 d completed.3
00000004 W data_start
00000004 b objects
00000004 d p.2
00000008 t fini_dummy
00000008 t init_dummy
00000008 t init_dummy
0000000c T main
00000018 t frame_dummy
00000018 b object.8
0000001c ? _fini
00000028 T __deregister_frame
00000028 t __do_global_ctors_aux
0000002c T __register_frame
0000002c T __register_frame_table
00000030 t count_fdes
00000031 ? _init
00000040 t decode_uleb128
00000044 t __do_global_dtors_aux
00000044 T _start
00000048 T __register_frame_info_table
0000004c T __register_frame_info
0000005c t decode_sleb128
0000005c t fde_insert
00000060 T __deregister_frame_info
00000094 t add_fdes
00000094 t find_fde
000000f8 t frame_init
0000013c t extract_cie_info
0000017c T __frame_state_for
00000334 ? __FRAME_BEGIN__
00000334 t execute_cfa_insn
bash$ exit



More information about the Gcc-bugs mailing list