I'm sending this a second time due to the list falldown. Please excuse me
if you receive this for the second time.

On Tue, 19 Feb 2002, Clarence Verge wrote:


> 
> As I said, I was struggling with "C".
> The first example program is, of course, "Hello world".
> It's an 8884 byte exe.
> 
> Here's my ASM version - just type it into debug.
> BTW, I just wrote it that way - all 23 bytes.
> Hello.com:
> 
> BA 09 01 B4 09 CD 21 CD 20 48 65 6C 6C 6F 20 77
> 6F 72 6C 64 0D 0A 24
> 
> And that certainly is not a record.<G>
> 
> - -  Clarence Verge.
> - -- Using Arachne 1.66 on DSL.
> 
> ------------------------------
> 

I have just compiled the "Hello World" using GCC (Linux).

The resulted ELF (binary executable) is 3062 bytes (striped). I believe
this includes some startup code and exit code (crt*.o) and, also symbol
and/or relocation tables 

If I link the program statically, the size increases to 215396 bytes (!).
There is quite a bunch of libraries there!    


The following is rather technical, skip it if you want . 

The assembler output of the compiler is:

        .file   "hello.c"
        .version        "01.01"
 gcc2_compiled.:
.section        .rodata
.LC0:
        .string "\nHello World!\n"
.text
        .align 4
.globl main
        .type    main,@function
main:
        pushl %ebp
        movl %esp,%ebp
        pushl $.LC0
        call printf
        leave
        ret
.Lfe1:
        .size    main,.Lfe1-main
        .ident  "GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2
release)"


Cristian Burneci





Reply via email to