Skip to contentSkip to conversation

function/data-sections

PATCH In review Denys Vlasenko 3 participants 11 messages Jul 28, 2010 – Aug 6, 2010

Subsystems (12)
Arm (32-bit) x86 PowerPC Kbuild +8 more subsystems
lore
Share & tools
lore
#0 lore raw

cover function/data-sections

Hi Michal,

Please take this patch series onto linux-kbuild.

Most of work needed for working -ffunction-sections -fdata-sections build is already in the mainline, but a few bits are still missing. In order to have a working kernel with this make invocation:
make KCFLAGS="-ffunction-sections -fdata-sections"
we need these patches:

modpost: support objects with more than 64k sections
This patch is in -mm, it still did not reach mainline, thus resending. Sam suggested some readability improvements.
module linker script: coalesce function and data sections kernel linker stripts: accomodate function and data sections boot linker stripts: accomodate function and data sections

Please see individual patches for more detailed changelogs.

A rough idea what sort of size savings are achievable with section garbage collection:
Kernel:
text data bss dec hex filename
8299299 857324 785348 9941971 97b3d3 2.6.35-rc4/vmlinux 7566908 832388 717844 9117140 8b1dd4 2.6.35-rc4-fsgs/vmlinux
-9.2% -2.9% -9.0% -8.6%
The largest module in the build:

 451009  54640   2224  507873  7bfe1 2.6.35-rc4/fs/xfs/xfs.ko
 450521  54292   2202  507015  7bc87 2.6.35-rc4-fsgs/fs/xfs/xfs.ko

(negligible size change since section garbage collection for modules is not done. TODO: figure out how to do it)

Denys Vlasenko (4):
modpost: support objects with more than 64k sections module linker script: coalesce sections
kernel linker stripts: accomodate function and data sections boot linker stripts: accomodate function and data sections

 arch/alpha/boot/bootloader.lds               |    6 +-
 arch/arm/boot/bootp/bootp.lds                |    1 +
 arch/cris/boot/compressed/decompress_v10.lds |    3 +
 arch/cris/boot/compressed/decompress_v32.lds |    3 +
 arch/cris/boot/rescue/rescue_v10.lds         |    2 +
 arch/cris/boot/rescue/rescue_v32.lds         |    3 +
 arch/frv/kernel/vmlinux.lds.S                |    1 -
 arch/h8300/boot/compressed/vmlinux.lds       |    2 +
 arch/h8300/boot/compressed/vmlinux.scr       |    1 +
 arch/ia64/hp/sim/boot/bootloader.lds         |    6 +-
 arch/ia64/scripts/check-segrel.lds           |    4 +-
 arch/m32r/boot/compressed/vmlinux.lds.S      |    6 +-
 arch/m32r/boot/compressed/vmlinux.scr        |    1 +
 arch/m68knommu/kernel/vmlinux.lds.S          |    1 +
 arch/mips/lasat/image/romscript.normal       |    1 +
 arch/mn10300/boot/compressed/vmlinux.lds     |    1 +
 arch/parisc/kernel/vmlinux.lds.S             |    1 +
 arch/powerpc/boot/zImage.coff.lds.S          |    2 +
 arch/powerpc/boot/zImage.lds.S               |    2 +
 arch/powerpc/boot/zImage.ps3.lds.S           |    2 +
 arch/sh/boot/compressed/vmlinux.scr          |    1 +
 arch/sh/kernel/vsyscall/vsyscall.lds.S       |    2 +-
 arch/x86/boot/setup.ld                       |    3 +-
 arch/x86/kernel/acpi/realmode/wakeup.lds.S   |    1 +
 arch/x86/kernel/vmlinux.lds.S                |    1 +
 arch/xtensa/boot/boot-elf/boot.lds.S         |    5 +-
 arch/xtensa/boot/boot-redboot/boot.ld        |    5 +-
 include/asm-generic/vmlinux.lds.h            |   18 ++++-
 scripts/mod/file2alias.c                     |    6 +-
 scripts/mod/modpost.c                        |  102 +++++++++++++++++++-------
 scripts/mod/modpost.h                        |   43 +++++++++++
 scripts/module-common.lds                    |   23 ++++++
 32 files changed, 213 insertions(+), 46 deletions(-)
#1 lore raw

PATCH 1/4 modpost: support objects with more than 64k sections

This patch makes modpost able to process object files with more than 64k sections. Needed for huge kernel builds (allyesconfig, for example) with -ffunction-sections.

---
 scripts/mod/file2alias.c |    6 +-
 scripts/mod/modpost.c    |  102 ++++++++++++++++++++++++++++++++++------------
 scripts/mod/modpost.h    |   43 +++++++++++++++++++
 3 files changed, 122 insertions(+), 29 deletions(-)
scripts/mod/file2alias.c +3 -3
index 5758aab..88f3f07 100644
@@ -884,16 +884,16 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
 	char *zeros = NULL;
 
 	/* We're looking for a section relative symbol */
-	if (!sym->st_shndx || sym->st_shndx >= info->hdr->e_shnum)
+	if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
 		return;
 
 	/* Handle all-NULL symbols allocated into .bss */
-	if (info->sechdrs[sym->st_shndx].sh_type & SHT_NOBITS) {
+	if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) {
 		zeros = calloc(1, sym->st_size);
 		symval = zeros;
 	} else {
 		symval = (void *)info->hdr
-			+ info->sechdrs[sym->st_shndx].sh_offset
+			+ info->sechdrs[get_secindex(info, sym)].sh_offset
 			+ sym->st_value;
 	}
 
scripts/mod/modpost.c +76 -26

207 lines not on this page · raw message

scripts/mod/modpost.h +43 -0

51 lines not on this page · raw message

Signature · 1 line
1.6.2.4
#2 lore raw

Re: [PATCH 1/4] modpost: support objects with more than 64k sections

Quoted 9 lines · Denys Vlasenko

This patch makes modpost able to process object files with more than 64k sections. Needed for huge kernel builds (allyesconfig, for example) with -ffunction-sections.

I forgot to mention in the changelog that 64k sections handling is covered, for example, by this document:

"IA-64 gABI Proposal 74: Section Indexes"
http://www.codesourcery.com/public/cxx-abi/abi/prop-74-sindex.html

Signature · 1 line
vda
#3 lore raw

PATCH 2/4 module linker script: coalesce function and data sections

In reply to Denys Vlasenko

gcc -ffunction-sections -fdata-sections places each function foo into separate section .text.foo, and every data object bar into separate section .data.bar, .rodata.bar or .bss.bar.

This fix prevents kernel modules from having unnecessarily many sections and thus prevents module size growth when we pass -ffunction-sections -fdata-sections to gcc.

Module linker script needs to avoid collecting special kernel sections, therefore it uses more restrictive patterns like *(.text.[A-Za-z0-9_$^]*) instead of simplistic *(.text.*): special kernel sections like .text..page_aligned contain double dots and won't be accidentally matched by them.

---
 scripts/module-common.lds |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
scripts/module-common.lds +23 -0
index 47a1f9a..4a197e8 100644
@@ -3,6 +3,29 @@
  * Archs are free to supply their own linker scripts.  ld will
  * combine them automatically.
  */
+
+/* .data.foo are generated by gcc itself with -fdata-sections,
+ * whereas double-dot sections (like .data..percpu) are generated
+ * by kernel's magic macros.
+ *
+ * Since this script does not specify what to do with double-dot sections,
+ * ld -r will coalesce all .data..foo input sections into one .data..foo
+ * output section, all .data..bar input sections into one .data..bar
+ * output section and so on. This is exactly what we want.
+ *
+ * Same goes for .text, .bss and .rodata. In case of .rodata, various
+ * .rodata.foo sections are generated by gcc even without -fdata-sections
+ */
+
 SECTIONS {
+
+	/* Coalesce sections produced by gcc -ffunction-sections */
+	.text   0 : AT(0) { *(.text .text.[A-Za-z0-9_$^]*) }
+
+	/* Coalesce sections produced by gcc -fdata-sections */
+	.rodata 0 : AT(0) { *(.rodata .rodata.[A-Za-z0-9_$^]*) }
+	.data   0 : AT(0) { *(.data .data.[A-Za-z0-9_$^]*) }
+	.bss    0 : AT(0) { *(.bss .bss.[A-Za-z0-9_$^]*) }
+
 	/DISCARD/ : { *(.discard) }
 }
Signature · 1 line
1.6.2.4
#4 lore raw

Re: [PATCH 2/4] module linker script: coalesce function and data sections

scripts/module-common.lds line 28

Quoted 2 lines · Denys Vlasenko
scripts/module-common.lds +2 -0
+	.data   0 : AT(0) { *(.data .data.[A-Za-z0-9_$^]*) }
+	.bss    0 : AT(0) { *(.bss .bss.[A-Za-z0-9_$^]*) }

What about .sdata and .sbss sections produced by arches that support small data sections?

David

#5 lore raw

Re: [PATCH 2/4] module linker script: coalesce function and data sections

Quoted 7 lines · David Howells

scripts/module-common.lds line 28

Quoted 2 lines · Denys Vlasenko
scripts/module-common.lds +2 -0
+	.data   0 : AT(0) { *(.data .data.[A-Za-z0-9_$^]*) }
+	.bss    0 : AT(0) { *(.bss .bss.[A-Za-z0-9_$^]*) }

What about .sdata and .sbss sections produced by arches that support small data sections?

linker groups all similarly-named input sections into one output section with the same name, if the name does not match any rule in the linker script.

Basically, it should work as if there is a rule:

.sbss 0 : AT(0) { *(.sbss) }

Signature · 1 line
vda
#6 lore raw

Re: [PATCH 2/4] module linker script: coalesce function and data sections

Quoted 7 lines · Denys Vlasenko

linker groups all similarly-named input sections into one output section with the same name, if the name does not match any rule in the linker script.

Basically, it should work as if there is a rule:

.sbss 0 : AT(0) { *(.sbss) }

Okay, thanks.

David

#7 lore raw

Re: [PATCH 2/4] module linker script: coalesce function and data sections

In reply to Denys Vlasenko

scripts/module-common.lds line 31

Quoted 12 lines · Denys Vlasenko

SECTIONS {

scripts/module-common.lds +9 -0
+
+	/* Coalesce sections produced by gcc -ffunction-sections */
+	.text   0 : AT(0) { *(.text .text.[A-Za-z0-9_$^]*) }
+
+	/* Coalesce sections produced by gcc -fdata-sections */
+	.rodata 0 : AT(0) { *(.rodata .rodata.[A-Za-z0-9_$^]*) }
+	.data   0 : AT(0) { *(.data .data.[A-Za-z0-9_$^]*) }
+	.bss    0 : AT(0) { *(.bss .bss.[A-Za-z0-9_$^]*) }
+
 	/DISCARD/ : { *(.discard) }
 }

I'm now getting

ld:/home/mmarek/linux-2.6/scripts/module-common.lds:23: ignoring invalid character ^' in script ld:/home/mmarek/linux-2.6/scripts/module-common.lds:26: ignoring invalid character ^' in script ld:/home/mmarek/linux-2.6/scripts/module-common.lds:27: ignoring invalid character ^' in script ld:/home/mmarek/linux-2.6/scripts/module-common.lds:28: ignoring invalid character ^' in script

when linking modules and a similar warning when linking vmlinux (caused by the next patch in series). I tried writing the carets as \^, but that doesn't help at all...

$ ld --version
GNU ld (GNU Binutils; openSUSE Factory) 2.20.0.20100122-7

Michal

#8 lore raw

Re: [PATCH 2/4] module linker script: coalesce function and data sections

Quoted 25 lines · Michal Marek

scripts/module-common.lds line 31

Quoted 12 lines · Denys Vlasenko

SECTIONS {

scripts/module-common.lds +9 -0
+
+	/* Coalesce sections produced by gcc -ffunction-sections */
+	.text   0 : AT(0) { *(.text .text.[A-Za-z0-9_$^]*) }
+
+	/* Coalesce sections produced by gcc -fdata-sections */
+	.rodata 0 : AT(0) { *(.rodata .rodata.[A-Za-z0-9_$^]*) }
+	.data   0 : AT(0) { *(.data .data.[A-Za-z0-9_$^]*) }
+	.bss    0 : AT(0) { *(.bss .bss.[A-Za-z0-9_$^]*) }
+
 	/DISCARD/ : { *(.discard) }
 }

I'm now getting

ld:/home/mmarek/linux-2.6/scripts/module-common.lds:23: ignoring invalid character ^' in script ld:/home/mmarek/linux-2.6/scripts/module-common.lds:26: ignoring invalid character ^' in script ld:/home/mmarek/linux-2.6/scripts/module-common.lds:27: ignoring invalid character ^' in script ld:/home/mmarek/linux-2.6/scripts/module-common.lds:28: ignoring invalid character ^' in script

Quoted 3 lines

when linking modules and a similar warning when linking vmlinux (caused by the next patch in series). I tried writing the carets as \^, but that doesn't help at all...

Yep, I can confirm it. The binutils fix to allow caret might be trivial, and will allow us to use much better pattern: [^.]*

I created a Fedora bug for it:

https://bugzilla.redhat.com/show_bug.cgi?id=621742

So far, please remove these three patches from kbuild tree.

(I see that modpost patch is in Linus tree. Thanks!)

Signature · 1 line
vda
#9 lore raw

PATCH 3/4 kernel linker stripts: accomodate function and data sections

In reply to Denys Vlasenko

gcc -ffunction-sections -fdata-sections places each function foo into separate section .text.foo, and every data object bar into separate section .data.bar, .rodata.bar or .bss.bar.

Kernel linker scripts were not ready for this and linker heuristics for orphaned sections were not good enough to result in bootable kernel.

This fix adds *(.text.*), *(.data.*) etc patterns directly after corresponding *(.text), *(.data) etc patterns in all kernel linker scripts. Boot scripts will be handled in the next fix.

include/asm-generic/vmlinux.lds.h is a little bit more complicated. It needs to avoid collecting special kernel sections
by using more restrictive patterns like *(.text.[A-Za-z0-9_$^]*) instead of simplistic *(.text.*): special kernel sections like .text..page_aligned contain double dots and won't be accidentally matched by them.

---
 arch/frv/kernel/vmlinux.lds.S              |    1 -
 arch/ia64/scripts/check-segrel.lds         |    4 ++--
 arch/m68knommu/kernel/vmlinux.lds.S        |    1 +
 arch/mips/lasat/image/romscript.normal     |    1 +
 arch/parisc/kernel/vmlinux.lds.S           |    1 +
 arch/sh/kernel/vsyscall/vsyscall.lds.S     |    2 +-
 arch/x86/kernel/acpi/realmode/wakeup.lds.S |    1 +
 arch/x86/kernel/vmlinux.lds.S              |    1 +
 include/asm-generic/vmlinux.lds.h          |   18 +++++++++++++++++-
 9 files changed, 25 insertions(+), 5 deletions(-)
arch/frv/kernel/vmlinux.lds.S +0 -1
index 8b973f3..9949f1a 100644
@@ -114,7 +114,6 @@ SECTIONS
 
   .sbss		: { *(.sbss .sbss.*) }
   .bss		: { *(.bss .bss.*) }
-  .bss..stack	: { *(.bss) }
 
   __bss_stop = .;
   _end = . ;
arch/ia64/scripts/check-segrel.lds +2 -2
index 85a0d54..1e23df4 100644
@@ -1,9 +1,9 @@
 SECTIONS {
 	. = SIZEOF_HEADERS;
-	.rodata : { *(.rodata) } :ro
+	.rodata : { *(.rodata) *(.rodata.*) } :ro
 	.note : { *(.note*) }
 	. = 0xa0000;
-	.data : { *(.data) } :dat
+	.data : { *(.data) *(.data.*) } :dat
 	/DISCARD/ : { *(*) }
 }
 PHDRS {
arch/m68knommu/kernel/vmlinux.lds.S +1 -0
index a91b271..c095a5b 100644
@@ -169,6 +169,7 @@ SECTIONS {
 		. = ALIGN(4);
 		_sbss = . ;
 		*(.bss)
+		*(.bss.*)
 		*(COMMON)
 		. = ALIGN(4) ;
 		_ebss = . ;
arch/mips/lasat/image/romscript.normal +1 -0
index 0864c96..408e5ad 100644
@@ -12,6 +12,7 @@ SECTIONS
   .data ALIGN(0x10) :
   {
     *(.data)
+    *(.data.*)
   }
   _image_start = ADDR(.data);
   _image_size = SIZEOF(.data);
arch/parisc/kernel/vmlinux.lds.S +1 -0
index d64a6bb..56d472c 100644
@@ -112,6 +112,7 @@ SECTIONS
 	}
 	.bss : {
 		*(.bss)
+		*(.bss.*)
 		*(COMMON)
 	}
 	__bss_stop = .;
arch/sh/kernel/vsyscall/vsyscall.lds.S +1 -1
index 6d59ee7..19ee0cb 100644
@@ -35,7 +35,7 @@ SECTIONS
 	 */
 	. = 0x400;
 
-	.text		: { *(.text) } 			:text	=0x90909090
+	.text		: { *(.text) *(.text.*) }	:text	=0x90909090
 	.note		: { *(.note.*) }		:text	:note
 	.eh_frame_hdr	: { *(.eh_frame_hdr ) }		:text	:eh_frame_hdr
 	.eh_frame	: {
arch/x86/kernel/acpi/realmode/wakeup.lds.S +1 -0
index 060fff8..38f18e8 100644
@@ -42,6 +42,7 @@ SECTIONS
 	.bss :	{
 		__bss_start = .;
 		*(.bss)
+		*(.bss.*)
 		__bss_end = .;
 	}
 
arch/x86/kernel/vmlinux.lds.S +1 -0
index d0bb522..eb5b2a6 100644
@@ -307,6 +307,7 @@ SECTIONS
 		__bss_start = .;
 		*(.bss..page_aligned)
 		*(.bss)
+		*(.bss.*)
 		. = ALIGN(4);
 		__bss_stop = .;
 	}
include/asm-generic/vmlinux.lds.h +17 -1
index 030a954..079895a 100644
@@ -146,9 +146,22 @@
 #define TRACE_SYSCALLS()
 #endif
 
+/* .data.foo are generated by gcc itself with -fdata-sections,
+ * whereas double-dot sections (like .data..percpu) are generated
+ * by kernel's magic macros.
+ *
+ * arch/.../vmlinux.lds.S decides where to place various double-dot sections
+ * as needed by its arch, here DATA_DATA needs to be careful and collect
+ * only .data and .data.foo sections, skipping .data..foo
+ *
+ * Same goes for .text, .bss and .rodata. In case of .rodata, various
+ * .rodata.foo sections are generated by gcc even without -fdata-sections
+ */
+
 /* .data section */
 #define DATA_DATA							\
 	*(.data)							\
+	*(.data.[A-Za-z0-9_$^]*)					\
 	*(.ref.data)							\
 	DEV_KEEP(init.data)						\
 	DEV_KEEP(exit.data)						\
@@ -212,7 +225,8 @@
 	. = ALIGN((align));						\
 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
 		VMLINUX_SYMBOL(__start_rodata) = .;			\
-		*(.rodata) *(.rodata.*)					\
+		*(.rodata)						\
+		*(.rodata.[A-Za-z0-9_$^]*)				\
 		*(__vermagic)		/* Kernel version magic */	\
 		*(__markers_strings)	/* Markers: strings */		\
 		*(__tracepoints_strings)/* Tracepoints: strings */	\
@@ -379,6 +393,7 @@
 		ALIGN_FUNCTION();					\
 		*(.text.hot)						\
 		*(.text)						\
+		*(.text.[A-Za-z0-9_$^]*)				\
 		*(.ref.text)						\
 	DEV_KEEP(init.text)						\
 	DEV_KEEP(exit.text)						\
@@ -512,6 +527,7 @@
 		*(.bss..page_aligned)					\
 		*(.dynbss)						\
 		*(.bss)							\
+		*(.bss.[A-Za-z0-9_$^]*)					\
 		*(COMMON)						\
 	}
 
Signature · 1 line
1.6.2.4
#10 lore raw

PATCH 4/4 boot linker stripts: accomodate function and data sections

In reply to Denys Vlasenko

gcc -ffunction-sections -fdata-sections places each function foo into separate section .text.foo, and every data object bar into separate section .data.bar, .rodata.bar or .bss.bar.

Boot linker scripts were not ready for this.

This fix adds *(.text.*), *(.data.*) etc patterns directly after corresponding *(.text), *(.data) etc patterns in all boot linker scripts.

This may be unnecessary, but I want to be function and data section-clean in all linker scripts, including boot ones.

---
 arch/alpha/boot/bootloader.lds               |    6 +++---
 arch/arm/boot/bootp/bootp.lds                |    1 +
 arch/cris/boot/compressed/decompress_v10.lds |    3 +++
 arch/cris/boot/compressed/decompress_v32.lds |    3 +++
 arch/cris/boot/rescue/rescue_v10.lds         |    2 ++
 arch/cris/boot/rescue/rescue_v32.lds         |    3 +++
 arch/h8300/boot/compressed/vmlinux.lds       |    2 ++
 arch/h8300/boot/compressed/vmlinux.scr       |    1 +
 arch/ia64/hp/sim/boot/bootloader.lds         |    6 +++---
 arch/m32r/boot/compressed/vmlinux.lds.S      |    6 +++---
 arch/m32r/boot/compressed/vmlinux.scr        |    1 +
 arch/mn10300/boot/compressed/vmlinux.lds     |    1 +
 arch/powerpc/boot/zImage.coff.lds.S          |    2 ++
 arch/powerpc/boot/zImage.lds.S               |    2 ++
 arch/powerpc/boot/zImage.ps3.lds.S           |    2 ++
 arch/sh/boot/compressed/vmlinux.scr          |    1 +
 arch/x86/boot/setup.ld                       |    3 ++-
 arch/xtensa/boot/boot-elf/boot.lds.S         |    5 ++++-
 arch/xtensa/boot/boot-redboot/boot.ld        |    5 ++++-
 19 files changed, 43 insertions(+), 12 deletions(-)
arch/alpha/boot/bootloader.lds +3 -3
index 31c081c..ff5374d 100644
@@ -4,17 +4,17 @@ printk = srm_printk;
 SECTIONS
 {
   . = 0x20000000;
-  .text : { *(.text) }
+  .text : { *(.text) *(.text.*) }
   _etext = .;
   PROVIDE (etext = .);
   .rodata : { *(.rodata) *(.rodata.*) }
-  .data : { *(.data) CONSTRUCTORS }
+  .data : { *(.data) *(.data.*) CONSTRUCTORS }
   .got : { *(.got) }
   .sdata : { *(.sdata) }
   _edata = .;
   PROVIDE (edata = .);
   .sbss : { *(.sbss) *(.scommon) }
-  .bss : { *(.bss) *(COMMON) }
+  .bss : { *(.bss) *(.bss.*) *(COMMON) }
   _end = . ;
   PROVIDE (end = .);
 
arch/arm/boot/bootp/bootp.lds +1 -0
index fc54394..14be7ff 100644
@@ -16,6 +16,7 @@ SECTIONS
    _stext = .;
    *(.start)
    *(.text)
+   *(.text.*)
    initrd_size = initrd_end - initrd_start;
    _etext = .;
   }
arch/cris/boot/compressed/decompress_v10.lds +3 -0
index e80f459..d6022d9 100644
@@ -13,6 +13,7 @@ SECTIONS
 	{
 		_stext = . ;
 		*(.text)
+		*(.text.*)
 		*(.rodata)
 		*(.rodata.*)
 		_etext = . ;
@@ -20,11 +21,13 @@ SECTIONS
 	.data :
 	{
 		*(.data)
+		*(.data.*)
 		_edata = . ;
 	} > dram
 	.bss :
 	{
 		*(.bss)
+		*(.bss.*)
 		_end = ALIGN( 0x10 ) ;
 	} > dram
 }
arch/cris/boot/compressed/decompress_v32.lds +3 -0
index 3c837fe..b5cfeb4 100644
@@ -13,6 +13,7 @@ SECTIONS
 	{
 		_stext = . ;
 		*(.text)
+		*(.text.*)
 		*(.rodata)
 		*(.rodata.*)
 		_etext = . ;
@@ -20,11 +21,13 @@ SECTIONS
 	.data :
 	{
 		*(.data)
+		*(.data.*)
 		_edata = . ;
 	} > dram
 	.bss :
 	{
 		*(.bss)
+		*(.bss.*)
 		_end = ALIGN( 0x10 ) ;
 	} > dram
 }
arch/cris/boot/rescue/rescue_v10.lds +2 -0
index 0b52a94..42b03a3 100644
@@ -10,11 +10,13 @@ SECTIONS
 	{
 		stext = . ;
 		*(.text)
+		*(.text.*)
 		etext = . ;
 	} > flash
 	.data :
 	{
 		*(.data)
+		*(.data.*)
 		edata = . ;
 	} > flash
 }
arch/cris/boot/rescue/rescue_v32.lds +3 -0
index 8ac646b..440ea40 100644
@@ -17,6 +17,7 @@ SECTIONS
 	{
 		_stext = . ;
 		*(.text)
+		*(.text.*)
 		*(.init.text)
 		*(.rodata)
 		*(.rodata.*)
@@ -25,12 +26,14 @@ SECTIONS
 	.data :
 	{
 		*(.data)
+		*(.data.*)
 		_edata = . ;
 	} > bootblk
 	.bss :
 	{
 		_bss = . ;
 		*(.bss)
+		*(.bss.*)
 		_end = ALIGN( 0x10 ) ;
 	} > intmem
 
arch/h8300/boot/compressed/vmlinux.lds +2 -0
index a0a3a0e..6896c9a 100644
@@ -6,12 +6,14 @@ SECTIONS
 	__text = .;
 	       *(.text..startup)
 	       *(.text)
+	       *(.text.*)
         __etext = . ;
         }
 
 	.rodata :
 	{
 		*(.rodata)
+		*(.rodata.*)
 	}
         .data :
 
arch/h8300/boot/compressed/vmlinux.scr +1 -0
index a0f6962..f4cfb3f 100644
@@ -4,6 +4,7 @@ SECTIONS
 	_input_len = .;
 	LONG(_input_data_end - _input_data) _input_data = .;
 	*(.data)
+	*(.data.*)
 	_input_data_end = .;
 	}
 }
arch/ia64/hp/sim/boot/bootloader.lds +3 -3
index 3977f25..56bf12c 100644
@@ -7,13 +7,13 @@ SECTIONS
   . = 0x100000;
 
   _text = .;
-  .text : { *(__ivt_section) *(.text) }
+  .text : { *(__ivt_section) *(.text) *(.text.*) }
   _etext = .;
 
   /* Global data */
   _data = .;
   .rodata : { *(.rodata) *(.rodata.*) }
-  .data    : { *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS }
+  .data    : { *(.data) *(.data.*) *(.gnu.linkonce.d*) CONSTRUCTORS }
   __gp = ALIGN (8) + 0x200000;
   .got           : { *(.got.plt) *(.got) }
   /* We want the small data sections together, so single-instruction offsets
@@ -24,7 +24,7 @@ SECTIONS
 
   __bss_start = .;
   .sbss      : { *(.sbss) *(.scommon) }
-  .bss       : { *(.bss) *(COMMON) }
+  .bss       : { *(.bss) *(.bss.*) *(COMMON) }
   . = ALIGN(64 / 8);
   __bss_stop = .;
   _end = . ;
arch/m32r/boot/compressed/vmlinux.lds.S +3 -3
index dd11963..d51580e 100644
@@ -6,12 +6,12 @@ SECTIONS
   . = CONFIG_MEMORY_START + 0x00400000;
 
   _text = .;
-  .text : { *(.text) } = 0
+  .text : { *(.text) *(.text.*) } = 0
   .rodata : { *(.rodata) *(.rodata.*) }
   _etext = .;
 
   . = ALIGN(32 / 8);
-  .data : { *(.data) }
+  .data : { *(.data) *(.data.*) }
   . = ALIGN(32 / 8);
   _got = .;
   .got  : { *(.got) _egot = .; *(.got.*) }
@@ -19,7 +19,7 @@ SECTIONS
 
   . = ALIGN(32 / 8);
   __bss_start = .;
-  .bss : { *(.bss) *(.sbss) }
+  .bss : { *(.bss) *(.bss.*) *(.sbss) }
   . = ALIGN(32 / 8);
   _ebss = .;
   . = ALIGN(4096);
arch/m32r/boot/compressed/vmlinux.scr +1 -0
index 924c799..253eff1 100644
@@ -3,6 +3,7 @@ SECTIONS
   .data : {
 	zimage_data = .;
 	*(.data)
+	*(.data.*)
 	zimage_data_end = .;
 	}
   zimage_len = zimage_data_end - zimage_data;
arch/mn10300/boot/compressed/vmlinux.lds +1 -0
index a084903..3e3e043 100644
@@ -4,6 +4,7 @@ SECTIONS
 	input_len = .;
 	LONG(input_data_end - input_data) input_data = .;
 	*(.data)
+	*(.data.*)
 	input_data_end = .;
 	}
 }
arch/powerpc/boot/zImage.coff.lds.S +2 -0
index 856dc78..504183a 100644
@@ -7,6 +7,7 @@ SECTIONS
   .text      :
   {
     *(.text)
+    *(.text.*)
     *(.fixup)
   }
   _etext = .;
@@ -41,6 +42,7 @@ SECTIONS
   {
    *(.sbss)
    *(.bss)
+   *(.bss.*)
   }
   _end = . ;
 
arch/powerpc/boot/zImage.lds.S +2 -0
index 0962d62..2815506 100644
@@ -7,6 +7,7 @@ SECTIONS
   .text      :
   {
     *(.text)
+    *(.text.*)
     *(.fixup)
   }
   _etext = .;
@@ -45,6 +46,7 @@ SECTIONS
   {
    *(.sbss)
    *(.bss)
+   *(.bss.*)
   }
   . = ALIGN(4096);
   _end = . ;
arch/powerpc/boot/zImage.ps3.lds.S +2 -0
index aaa469c..a29ce62 100644
@@ -21,6 +21,7 @@ SECTIONS
   .text      :
   {
     *(.text)
+    *(.text.*)
     *(.fixup)
   }
   _etext = .;
@@ -44,6 +45,7 @@ SECTIONS
   {
    *(.sbss)
    *(.bss)
+   *(.bss.*)
   }
   . = ALIGN(4096);
   _end = . ;
arch/sh/boot/compressed/vmlinux.scr +1 -0
index 862d748..e7d733f 100644
@@ -4,6 +4,7 @@ SECTIONS
 	input_len = .;
 	LONG(input_data_end - input_data) input_data = .;
 	*(.data)
+	*(.data.*)
 	output_len = . - 4;
 	input_data_end = .;
 	}
arch/x86/boot/setup.ld +2 -1
index 03c0683..a4af992 100644
@@ -20,7 +20,7 @@ SECTIONS
 	.initdata	: { *(.initdata) }
 	__end_init = .;
 
-	.text		: { *(.text) }
+	.text		: { *(.text) *(.text.*) }
 	.text32		: { *(.text32) }
 
 	. = ALIGN(16);
@@ -46,6 +46,7 @@ SECTIONS
 	{
 		__bss_start = .;
 		*(.bss)
+		*(.bss.*)
 		__bss_end = .;
 	}
 	. = ALIGN(16);
arch/xtensa/boot/boot-elf/boot.lds.S +4 -1
index 4e53b74..368d766 100644
@@ -10,19 +10,21 @@ SECTIONS
 	{
 		__reloc_start = . ;
 		_text_start = . ;
-		*(.literal .text.literal .text)
+		*(.literal .text.literal .text .text.*)
 		_text_end = . ;
 	}
 
 	.rodata ALIGN(0x04):
 	{
 		*(.rodata)
+		*(.rodata.*)
 		*(.rodata1)
 	}
 
 	.data ALIGN(0x04):
 	{
 		*(.data)
+		*(.data.*)
 		*(.data1)
 		*(.sdata)
 		*(.sdata2)
@@ -58,6 +60,7 @@ SECTIONS
 		*(.scommon)
 		*(.dynbss)
 		*(.bss)
+		*(.bss.*)
 		__bss_end = .;
 	}
 	_end = .;
arch/xtensa/boot/boot-redboot/boot.ld +4 -1
index 774db20..8747b68 100644
@@ -8,19 +8,21 @@ SECTIONS
 	{
 		__reloc_start = . ;
 		_text_start = . ;
-		*(.literal .text.literal .text)
+		*(.literal .text.literal .text .text.*)
 		_text_end = . ;
 	}
 
 	.rodata ALIGN(0x04):
 	{
 		*(.rodata)
+		*(.rodata.*)
 		*(.rodata1)
 	}
 
 	.data ALIGN(0x04):
 	{
 		*(.data)
+		*(.data.*)
 		*(.data1)
 		*(.sdata)
 		*(.sdata2)
@@ -56,6 +58,7 @@ SECTIONS
 		*(.scommon)
 		*(.dynbss)
 		*(.bss)
+		*(.bss.*)
 		__bss_end = .;
 	}
 	_end = .;
Signature · 1 line
1.6.2.4