[jjohn@localhost hello]$ gcc -Wall -static hello.c
[jjohn@localhost hello]$ file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, statically linked, not stripped
[jjohn@localhost hello]$ ls -l
total 424
-rwxrwxr-x 1 jjohn jjohn 424535 Jun 1 17:50 a.out
-rw-rw-r-- 1 jjohn jjohn 90 Jun 1 17:50 hello.c
[jjohn@localhost hello]$./a.out
Hello
Good gravy, that's one fine statically compiled binary that's more than 4000 times the size of the source code. It doesn't just print "Hello", it prints the hell of out it!
Static linking (Score:2)
That is what you expect with static linking, is it not? I'm not sure you could say there's anything "wrong."
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
Re:Static linking (Score:1)
Re:Static linking (Score:2)
I presume it's linking in libc.a. Here are some libc.a sizes on systems I have access to at the moment:
Maybe that's a lot larger than it was back in the day, but it seems about right to me.
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers