[PATCH 1/4] build system: section garbage collection for vmlinux

From: Denys Vlasenko
Date: Tue Sep 11 2007 - 16:17:15 EST


This patch is needed for --gc-sections to work, regardless
of which final form that support will have.

This patch renames .text.xxx and .data.xxx sections
into .xxx.text and .xxx.data, respectively.

.bss.page_aligned (the only .bss.xxx -like section we have)
is renamed .bss.k.page_aligned. ".page_aligned.bss"
wouldn't work - gcc will assign such section attributes
which make it unmergeable with .bss. In fact, binutils ld
had a bug and instead of complaining was producing
broken vmlinux. The bug is fixed in binutils. Amazingly
fast reaction from binutils folks to bug reports! Thanks!

.bss.k.page_aligned is more-or-less ok, since it cannot collide
with gcc-produced sections due to second dot in the name. However,
should we want to do this in linker script:

.bss : { *(.bss) *(.bss.*) *(.bss.k.page_aligned))

it wouldn't work. But currently we don't need that.

If patch doesn't apply to a newer kernel,
you can regenerate it by running linux-2.6.23-rc4.0.fixname.sh
in a kernel free and rediffing it against unmodified one.

Please apply.

Signed-off-by: Denys Vlasenko <vda.linux@xxxxxxxxxxxxxx>
--
vda

Attachment: linux-2.6.23-rc4.0.fixname.sh
Description: application/shellscript

Attachment: linux-2.6.23-rc4.1.fixname.patch.bz2
Description: BZip2 compressed data