--- linux-2.6.35-rc4/arch/alpha/boot/bootloader.lds +++ linux-2.6.35-rc4.new/arch/alpha/boot/bootloader.lds @@ -4,17 +4,17 @@ SECTIONS { . = 0x20000000; - .text : { *(.text) } + .text : { *(.text .text.*) } _etext = .; PROVIDE (etext = .); - .rodata : { *(.rodata) *(.rodata.*) } - .data : { *(.data) CONSTRUCTORS } + .rodata : { *(.rodata .rodata.*) } + .data : { *(.data .data.*) CONSTRUCTORS } .got : { *(.got) } .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); .sbss : { *(.sbss) *(.scommon) } - .bss : { *(.bss) *(COMMON) } + .bss : { *(.bss .bss.*) *(COMMON) } _end = . ; PROVIDE (end = .); --- linux-2.6.35-rc4/arch/arm/boot/bootp/bootp.lds +++ linux-2.6.35-rc4.new/arch/arm/boot/bootp/bootp.lds @@ -15,7 +15,7 @@ .text : { _stext = .; *(.start) - *(.text) + *(.text .text.*) initrd_size = initrd_end - initrd_start; _etext = .; } --- linux-2.6.35-rc4/arch/arm/boot/compressed/vmlinux.lds.in +++ linux-2.6.35-rc4.new/arch/arm/boot/compressed/vmlinux.lds.in @@ -29,12 +29,10 @@ .text : { _start = .; *(.start) - *(.text) - *(.text.*) + *(.text .text.*) *(.fixup) *(.gnu.warning) - *(.rodata) - *(.rodata.*) + *(.rodata .rodata.*) *(.glue_7) *(.glue_7t) *(.piggydata) --- linux-2.6.35-rc4/arch/arm/kernel/vmlinux.lds.S +++ linux-2.6.35-rc4.new/arch/arm/kernel/vmlinux.lds.S @@ -95,8 +95,7 @@ *(.fixup) #endif *(.gnu.warning) - *(.rodata) - *(.rodata.*) + *(.rodata .rodata.*) *(.glue_7) *(.glue_7t) *(.got) /* Global offset table */ --- linux-2.6.35-rc4/arch/cris/boot/compressed/decompress_v10.lds +++ linux-2.6.35-rc4.new/arch/cris/boot/compressed/decompress_v10.lds @@ -12,19 +12,18 @@ .text : { _stext = . ; - *(.text) - *(.rodata) - *(.rodata.*) + *(.text .text.*) + *(.rodata .rodata.*) _etext = . ; } > dram .data : { - *(.data) + *(.data .data.*) _edata = . ; } > dram .bss : { - *(.bss) + *(.bss .bss.*) _end = ALIGN( 0x10 ) ; } > dram } --- linux-2.6.35-rc4/arch/cris/boot/compressed/decompress_v32.lds +++ linux-2.6.35-rc4.new/arch/cris/boot/compressed/decompress_v32.lds @@ -12,19 +12,18 @@ .text : { _stext = . ; - *(.text) - *(.rodata) - *(.rodata.*) + *(.text .text.*) + *(.rodata .rodata.*) _etext = . ; } > dram .data : { - *(.data) + *(.data .data.*) _edata = . ; } > dram .bss : { - *(.bss) + *(.bss .bss.*) _end = ALIGN( 0x10 ) ; } > dram } --- linux-2.6.35-rc4/arch/cris/boot/rescue/rescue_v10.lds +++ linux-2.6.35-rc4.new/arch/cris/boot/rescue/rescue_v10.lds @@ -9,12 +9,12 @@ .text : { stext = . ; - *(.text) + *(.text .text.*) etext = . ; } > flash .data : { - *(.data) + *(.data .data.*) edata = . ; } > flash } --- linux-2.6.35-rc4/arch/cris/boot/rescue/rescue_v32.lds +++ linux-2.6.35-rc4.new/arch/cris/boot/rescue/rescue_v32.lds @@ -16,21 +16,20 @@ .text : { _stext = . ; - *(.text) + *(.text .text.*) *(.init.text) - *(.rodata) - *(.rodata.*) + *(.rodata .rodata.*) _etext = . ; } > bootblk .data : { - *(.data) + *(.data .data.*) _edata = . ; } > bootblk .bss : { _bss = . ; - *(.bss) + *(.bss .bss.*) _end = ALIGN( 0x10 ) ; } > intmem --- linux-2.6.35-rc4/arch/frv/kernel/vmlinux.lds.S +++ linux-2.6.35-rc4.new/arch/frv/kernel/vmlinux.lds.S @@ -114,7 +114,7 @@ .sbss : { *(.sbss .sbss.*) } .bss : { *(.bss .bss.*) } - .bss..stack : { *(.bss) } + .bss..stack : { *(.bss) } /* BUG??? we already absorbed it into .bss */ __bss_stop = .; _end = . ; --- linux-2.6.35-rc4/arch/h8300/boot/compressed/vmlinux.lds +++ linux-2.6.35-rc4.new/arch/h8300/boot/compressed/vmlinux.lds @@ -5,13 +5,13 @@ __stext = . ; __text = .; *(.text..startup) - *(.text) + *(.text .text.*) __etext = . ; } .rodata : { - *(.rodata) + *(.rodata .rodata.*) } .data : --- linux-2.6.35-rc4/arch/h8300/boot/compressed/vmlinux.scr +++ linux-2.6.35-rc4.new/arch/h8300/boot/compressed/vmlinux.scr @@ -3,7 +3,7 @@ .data : { _input_len = .; LONG(_input_data_end - _input_data) _input_data = .; - *(.data) + *(.data .data.*) _input_data_end = .; } } --- linux-2.6.35-rc4/arch/ia64/hp/sim/boot/bootloader.lds +++ linux-2.6.35-rc4.new/arch/ia64/hp/sim/boot/bootloader.lds @@ -7,13 +7,13 @@ . = 0x100000; _text = .; - .text : { *(__ivt_section) *(.text) } + .text : { *(__ivt_section) *(.text .text.*) } _etext = .; /* Global data */ _data = .; - .rodata : { *(.rodata) *(.rodata.*) } - .data : { *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS } + .rodata : { *(.rodata .rodata.*) } + .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 @@ __bss_start = .; .sbss : { *(.sbss) *(.scommon) } - .bss : { *(.bss) *(COMMON) } + .bss : { *(.bss .bss.*) *(COMMON) } . = ALIGN(64 / 8); __bss_stop = .; _end = . ; --- linux-2.6.35-rc4/arch/ia64/kernel/gate.lds.S +++ linux-2.6.35-rc4.new/arch/ia64/kernel/gate.lds.S @@ -54,10 +54,10 @@ .IA_64.unwind_info : { *(.IA_64.unwind_info*) } .IA_64.unwind : { *(.IA_64.unwind*) } :readable :unwind #ifdef HAVE_BUGGY_SEGREL - .text (GATE_ADDR + PAGE_SIZE) : { *(.text) *(.text.*) } :readable + .text (GATE_ADDR + PAGE_SIZE) : { *(.text .text.*) } :readable #else . = ALIGN(PERCPU_PAGE_SIZE) + (. & (PERCPU_PAGE_SIZE - 1)); - .text : { *(.text) *(.text.*) } :epc + .text : { *(.text .text.*) } :epc #endif /DISCARD/ : { --- linux-2.6.35-rc4/arch/ia64/scripts/check-segrel.lds +++ linux-2.6.35-rc4.new/arch/ia64/scripts/check-segrel.lds @@ -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 { --- linux-2.6.35-rc4/arch/m32r/boot/compressed/vmlinux.lds.S +++ linux-2.6.35-rc4.new/arch/m32r/boot/compressed/vmlinux.lds.S @@ -6,12 +6,12 @@ . = CONFIG_MEMORY_START + 0x00400000; _text = .; - .text : { *(.text) } = 0 - .rodata : { *(.rodata) *(.rodata.*) } + .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 @@ . = ALIGN(32 / 8); __bss_start = .; - .bss : { *(.bss) *(.sbss) } + .bss : { *(.bss .bss.*) *(.sbss) } . = ALIGN(32 / 8); _ebss = .; . = ALIGN(4096); --- linux-2.6.35-rc4/arch/m32r/boot/compressed/vmlinux.scr +++ linux-2.6.35-rc4.new/arch/m32r/boot/compressed/vmlinux.scr @@ -2,7 +2,7 @@ { .data : { zimage_data = .; - *(.data) + *(.data .data.*) zimage_data_end = .; } zimage_len = zimage_data_end - zimage_data; --- linux-2.6.35-rc4/arch/m68knommu/kernel/vmlinux.lds.S +++ linux-2.6.35-rc4.new/arch/m68knommu/kernel/vmlinux.lds.S @@ -75,7 +75,7 @@ *(__ex_table) __stop___ex_table = .; - *(.rodata) *(.rodata.*) + *(.rodata .rodata.*) *(__vermagic) /* Kernel version magic */ *(__markers_strings) *(.rodata1) @@ -168,7 +168,7 @@ .bss : { . = ALIGN(4); _sbss = . ; - *(.bss) + *(.bss .bss.*) *(COMMON) . = ALIGN(4) ; _ebss = . ; --- linux-2.6.35-rc4/arch/mips/lasat/image/romscript.normal +++ linux-2.6.35-rc4.new/arch/mips/lasat/image/romscript.normal @@ -11,7 +11,7 @@ .data ALIGN(0x10) : { - *(.data) + *(.data .data.*) } _image_start = ADDR(.data); _image_size = SIZEOF(.data); --- linux-2.6.35-rc4/arch/mn10300/boot/compressed/vmlinux.lds +++ linux-2.6.35-rc4.new/arch/mn10300/boot/compressed/vmlinux.lds @@ -3,7 +3,7 @@ .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; - *(.data) + *(.data .data.*) input_data_end = .; } } --- linux-2.6.35-rc4/arch/parisc/kernel/vmlinux.lds.S +++ linux-2.6.35-rc4.new/arch/parisc/kernel/vmlinux.lds.S @@ -111,7 +111,7 @@ *(.data..vm0.pte) } .bss : { - *(.bss) + *(.bss .bss.*) *(COMMON) } __bss_stop = .; --- linux-2.6.35-rc4/arch/powerpc/boot/zImage.coff.lds.S +++ linux-2.6.35-rc4.new/arch/powerpc/boot/zImage.coff.lds.S @@ -6,7 +6,7 @@ _start = .; .text : { - *(.text) + *(.text .text.*) *(.fixup) } _etext = .; @@ -40,7 +40,7 @@ .bss : { *(.sbss) - *(.bss) + *(.bss .bss.*) } _end = . ; --- linux-2.6.35-rc4/arch/powerpc/boot/zImage.lds.S +++ linux-2.6.35-rc4.new/arch/powerpc/boot/zImage.lds.S @@ -6,7 +6,7 @@ _start = .; .text : { - *(.text) + *(.text .text.*) *(.fixup) } _etext = .; @@ -44,7 +44,7 @@ .bss : { *(.sbss) - *(.bss) + *(.bss .bss.*) } . = ALIGN(4096); _end = . ; --- linux-2.6.35-rc4/arch/powerpc/boot/zImage.ps3.lds.S +++ linux-2.6.35-rc4.new/arch/powerpc/boot/zImage.ps3.lds.S @@ -20,7 +20,7 @@ _start = .; .text : { - *(.text) + *(.text .text.*) *(.fixup) } _etext = .; @@ -43,7 +43,7 @@ .bss : { *(.sbss) - *(.bss) + *(.bss .bss.*) } . = ALIGN(4096); _end = . ; --- linux-2.6.35-rc4/arch/sh/boot/compressed/vmlinux.scr +++ linux-2.6.35-rc4.new/arch/sh/boot/compressed/vmlinux.scr @@ -3,7 +3,7 @@ .rodata..compressed : { input_len = .; LONG(input_data_end - input_data) input_data = .; - *(.data) + *(.data .data.*) output_len = . - 4; input_data_end = .; } --- linux-2.6.35-rc4/arch/sh/kernel/vsyscall/vsyscall.lds.S +++ linux-2.6.35-rc4.new/arch/sh/kernel/vsyscall/vsyscall.lds.S @@ -35,7 +35,7 @@ */ . = 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 : { --- linux-2.6.35-rc4/arch/x86/boot/setup.ld +++ linux-2.6.35-rc4.new/arch/x86/boot/setup.ld @@ -20,7 +20,7 @@ .initdata : { *(.initdata) } __end_init = .; - .text : { *(.text) } + .text : { *(.text .text.*) } .text32 : { *(.text32) } . = ALIGN(16); @@ -45,7 +45,7 @@ .bss : { __bss_start = .; - *(.bss) + *(.bss .bss.*) __bss_end = .; } . = ALIGN(16); --- linux-2.6.35-rc4/arch/x86/kernel/acpi/realmode/wakeup.lds.S +++ linux-2.6.35-rc4.new/arch/x86/kernel/acpi/realmode/wakeup.lds.S @@ -41,7 +41,7 @@ . = ALIGN(16); .bss : { __bss_start = .; - *(.bss) + *(.bss .bss.*) __bss_end = .; } --- linux-2.6.35-rc4/arch/x86/kernel/vmlinux.lds.S +++ linux-2.6.35-rc4.new/arch/x86/kernel/vmlinux.lds.S @@ -306,7 +306,7 @@ .bss : AT(ADDR(.bss) - LOAD_OFFSET) { __bss_start = .; *(.bss..page_aligned) - *(.bss) + *(.bss .bss.*) . = ALIGN(4); __bss_stop = .; } --- linux-2.6.35-rc4/arch/xtensa/boot/boot-elf/boot.lds.S +++ linux-2.6.35-rc4.new/arch/xtensa/boot/boot-elf/boot.lds.S @@ -10,19 +10,19 @@ { __reloc_start = . ; _text_start = . ; - *(.literal .text.literal .text) + *(.literal .text.literal .text .text.*) _text_end = . ; } .rodata ALIGN(0x04): { - *(.rodata) + *(.rodata .rodata.*) *(.rodata1) } .data ALIGN(0x04): { - *(.data) + *(.data .data.*) *(.data1) *(.sdata) *(.sdata2) @@ -57,7 +57,7 @@ *(.sbss) *(.scommon) *(.dynbss) - *(.bss) + *(.bss .bss.*) __bss_end = .; } _end = .; --- linux-2.6.35-rc4/arch/xtensa/boot/boot-redboot/boot.ld +++ linux-2.6.35-rc4.new/arch/xtensa/boot/boot-redboot/boot.ld @@ -8,19 +8,19 @@ { __reloc_start = . ; _text_start = . ; - *(.literal .text.literal .text) + *(.literal .text.literal .text .text.*) _text_end = . ; } .rodata ALIGN(0x04): { - *(.rodata) + *(.rodata .rodata.*) *(.rodata1) } .data ALIGN(0x04): { - *(.data) + *(.data .data.*) *(.data1) *(.sdata) *(.sdata2) @@ -55,7 +55,7 @@ *(.sbss) *(.scommon) *(.dynbss) - *(.bss) + *(.bss .bss.*) __bss_end = .; } _end = .; --- linux-2.6.35-rc4/include/asm-generic/vmlinux.lds.h +++ linux-2.6.35-rc4.new/include/asm-generic/vmlinux.lds.h @@ -140,9 +140,21 @@ #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 .data.[A-Za-z0-9_$^]*) \ *(.ref.data) \ DEV_KEEP(init.data) \ DEV_KEEP(exit.data) \ @@ -202,7 +214,7 @@ . = 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 */ \ @@ -501,7 +513,7 @@ .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ *(.bss..page_aligned) \ *(.dynbss) \ - *(.bss) \ + *(.bss .bss.[A-Za-z0-9_$^]*) \ *(COMMON) \ }