l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2004 Nov 24 14:06

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Understanding a C hello world program
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Understanding a C hello world program

On Wed, Nov 24, 2004 at 11:10:34AM -0800, Mark K. Kim wrote:
> On Wed, 24 Nov 2004, Peter Jay Salzman wrote:
> [snip]
> >    p@satan$ size hello_world-1.o
> >       text    data     bss     dec     hex filename
> >         48       0       0      48      30 hello_world-1.o
> [snip]
> What the... how did you make your program so small?  My output:
>   $gcc hello.c -o hello
>   $size hello
>      text    data     bss     dec     hex filename
>       960     256       4    1220     4c4 hello
>   $strip hello
>   $size hello
>      text    data     bss     dec     hex filename
>       960     256       4    1220     4c4 hello
>   $ls -l hello
>   -rwxr-xr-x  1 mark    mark    2948 Nov 24 10:24 hello*
>   $gcc --version
>   gcc (GCC) 3.3.5 (Debian 1:3.3.5-2)
>   [snip]
> -_-'

He's working with hello.o, the output of gcc -c hello.c
You're working with hello, the output of gcc -o hello hello.c
So yours is a completely linked version of the file, and his is the
object file pre-linking. He could use ld -o hello $LIBARIES hello.o to
get what you have.

--Ken Bloom

I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.

Attachment: signature.asc
Description: Digital signature

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.