From: Thiemo Seufer <ths@networkno.de>
To: linux-mips@linux-mips.org
Cc: ralf@linux-mips.org
Subject: Kernel binary size changes in dependence of the gcc version
Date: Thu, 8 Jun 2006 11:13:35 +0100 [thread overview]
Message-ID: <20060608101335.GA22883@networkno.de> (raw)
Hello All,
I wondered how the various gcc versions influence the size of the
kernel binary, and what difference a size-optimised build makes.
The appended overview is for a Broadcom/Sibyte kernel with some
amount of drivers built in, so the absolute numbers aren't that
relevant. The configuration was always the same except for
CONFIG_64BIT and CONFIG_CC_OPTIMIZE_FOR_SIZE.
Thiemo
32 bit:
-------
Kernel 2.6.17-rc5 Sibyte SWARM 32 bit, default compiler options:
text data bss dec hex filename
3500246 319636 172080 3991962 3ce99a vmlinux # gcc-3.3 (3.3.6-13)
3440510 291012 172080 3903602 3b9072 vmlinux # gcc-3.4 (3.4.6-1)
3482825 291140 172080 3946045 3c363d vmlinux # gcc-4.0 (4.0.3-3)
3452750 288164 172080 3912994 3bb522 vmlinux # gcc-4.1 (4.1.0-4)
3455566 288164 172080 3915810 3bc022 vmlinux # gcc-snapshot (20060530-1)
Kernel 2.6.17-rc5 Sibyte SWARM 32 bit, size optimized build:
text data bss dec hex filename
3423398 319636 172080 3915114 3bbd6a vmlinux # gcc-3.3 (3.3.6-13)
3224502 291012 172080 3687594 3844aa vmlinux # gcc-3.4 (3.4.6-1)
Newer gcc versions fail to build the 2.6.17-rc5 32 bit kernel with
-Os due to unresolved references to libgcc. With a kernel patch
providing libgcc functions, and a 2.6.17-rc6 snapshot:
text data bss dec hex filename
3415310 319620 172080 3907010 3b9dc2 vmlinux # gcc-3.3 (3.3.6-13)
3215829 290996 172080 3678905 3822b9 vmlinux # gcc-3.4 (3.4.6-1)
3175683 290404 172080 3638167 378397 vmlinux # gcc-4.0 (4.0.3-3)
3184250 287348 172080 3643678 37991e vmlinux # gcc-4.1 (4.1.0-4)
3198118 287348 172080 3657546 37cf4a vmlinux # gcc-snapshot (20060530-1)
64 bit:
-------
The difference in size from gcc-3.4 to gcc-4.0 for 64 bit kernels is to
a large part caused by the use of -msym32, which is only available
since gcc-4.0.
Kernel 2.6.17-rc5 Sibyte SWARM 64 bit, default compiler options:
text data bss dec hex filename
4240626 506688 258096 5005410 4c6062 vmlinux # gcc-3.3 (3.3.6-13)
4183387 469024 258096 4910507 4aedab vmlinux # gcc-3.4 (3.4.6-1)
3740658 469272 258096 4468026 442d3a vmlinux # gcc-4.0 (4.0.3-3)
3701722 463904 258096 4423722 43802a vmlinux # gcc-4.1 (4.1.0-4)
3703474 463904 258096 4425474 438702 vmlinux # gcc-snapshot (20060530-1)
Kernel 2.6.17-rc5 Sibyte SWARM 64 bit, size optimized build:
text data bss dec hex filename
4110677 506688 258096 4875461 4a64c5 vmlinux # gcc-3.3 (3.3.6-13)
3912126 469024 258096 4639246 46ca0e vmlinux # gcc-3.4 (3.4.6-1)
3384418 468248 258096 4110762 3eb9aa vmlinux # gcc-4.0 (4.0.3-3)
3389841 462880 258096 4110817 3eb9e1 vmlinux # gcc-4.1 (4.1.0-4)
3401534 462880 258096 4122510 3ee78e vmlinux # gcc-snapshot (20060530-1)
reply other threads:[~2006-06-08 10:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060608101335.GA22883@networkno.de \
--to=ths@networkno.de \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.