[PATCH 2/3] build system: section garbage collection for vmlinux

Denys Vlasenko
2007-09-05T13:49:39Z

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

On Wednesday 05 September 2007 14:47, Denys Vlasenko wrote:
> On Wednesday 05 September 2007 14:43, Denys Vlasenko wrote:
> > These patches fix section names and add
> > CONFIG_DISCARD_UNUSED_SECTIONS. It is not enabled
> > unconditionally because only newest binutils have
> > ld --gc-sections which is stable enough for kernel use.
> > IOW: this is an experimental feature for now.
>
> Part 1: fix section names over entire source (all arches).

Part 2: fix x86_64 vdso linker script to not produce
broken vdso image with gcc -ffunction-sections -fdata-sections.

Does not affect normal build.
--
vda

[-- Attachment #2: linux-2.6.23-rc4.2.vdso.lds.patch --]
[-- Type: text/x-diff, Size: 758 bytes --]

--- linux-2.6.23-rc4.gc1/arch/x86_64/vdso/vdso.lds.S Tue Sep 4 21:48:52 2007
+++ linux-2.6.23-rc4.gc2/arch/x86_64/vdso/vdso.lds.S Tue Sep 4 21:49:17 2007
@@ -26,11 +26,11 @@
is insufficient, ld -shared will barf. Just increase it here. */
. = VDSO_PRELINK + VDSO_TEXT_OFFSET;

- .text : { *(.text) } :text
+ .text : { *(.text) *(.text.*) } :text
.text_ptr : { *(.text_ptr) } :text
. = VDSO_PRELINK + 0x900;
- .data : { *(.data) } :text
- .bss : { *(.bss) } :text
+ .data : { *(.data) *(.data.*) } :text
+ .bss : { *(.bss) *(.bss.*) } :text

.altinstructions : { *(.altinstructions) } :text
.altinstr_replacement : { *(.altinstr_replacement) } :text