Why is GNU/Linux so Bloated?

Why is GNU/Linux so Bloated?

Shlomi Fish shlomif at iglu.org.il
Sun Jun 21 11:49:15 IDT 2009


On Thursday 11 June 2009 16:59:32 Shlomi Fish wrote:
> Hi all!
>
> Based on the gcc-4.4.0 (with -Os) / x86-Linux shared library sizes here:
>
> http://tech.groups.yahoo.com/group/fc-solve-discuss/message/998
>
> And the Visual C++/Win32 (also x86) .dll sizes here:
>
> http://tech.groups.yahoo.com/group/fc-solve-discuss/message/999
>
> My question is: why are the Visual C++ generated binaries so much smaller
> than the equivalent Linux ones? Any insights would be appreciated.
>

Replying to myself, I'd like to note that I did the following test:

{{{{
shlomi:~$ cat test_shared_lib.c

int myzero()
{
    return 0;
}
shlomi:~$ gcc -Os -o libtest.so -shared test_shared_lib.c
shlomi:~$ ls -l libtest.so
-rwxr-xr-x 1 shlomi shlomi 3768 2009-06-21 11:44 libtest.so
shlomi:~$ strip libtest.so
shlomi:~$ ls -l libtest.so
-rwxr-xr-x 1 shlomi shlomi 2448 2009-06-21 11:44 libtest.so
shlomi:~$
}}}}

So the overhead of having a mostly-empty shared library is 2,448 bytes (or 
3,768 bytes before strip) which isn't very high, and doesn't explain why the 
gcc-generated code is so much larger than the MSVC-generated one.

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Funny Anti-Terrorism Story - http://xrl.us/bjn7t

God gave us two eyes and ten fingers so we will type five times as much as we
read.



More information about the Linux-il mailing list