Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fix

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fix:
mm/slab: fix section mismatch warning
mm: fix section mismatch warnings
init/main: use __init_refok to fix section mismatch
kbuild: introduce __init_refok/__initdata_refok to supress section mismatch warnings
all-archs: consolidate .data section definition in asm-generic
all-archs: consolidate .text section definition in asm-generic
kbuild: add "Section mismatch" warning whitelist for powerpc
kbuild: make better section mismatch reports on i386, arm and mips
kbuild: make modpost section warnings clearer
kconfig: search harder for curses library in check-lxdialog.sh
kbuild: include limits.h in sumversion.c for PATH_MAX
powerpc: Fix the MODALIAS generation in modpost for of devices

+234 -132
+2 -2
arch/alpha/kernel/vmlinux.lds.S
··· 15 16 _text = .; /* Text and read-only data */ 17 .text : { 18 - *(.text) 19 SCHED_TEXT 20 LOCK_TEXT 21 *(.fixup) ··· 89 90 _data = .; 91 .data : { /* Data */ 92 - *(.data) 93 CONSTRUCTORS 94 } 95
··· 15 16 _text = .; /* Text and read-only data */ 17 .text : { 18 + TEXT_TEXT 19 SCHED_TEXT 20 LOCK_TEXT 21 *(.fixup) ··· 89 90 _data = .; 91 .data : { /* Data */ 92 + DATA_DATA 93 CONSTRUCTORS 94 } 95
+2 -2
arch/arm/kernel/vmlinux.lds.S
··· 90 __exception_text_start = .; 91 *(.exception.text) 92 __exception_text_end = .; 93 - *(.text) 94 SCHED_TEXT 95 LOCK_TEXT 96 #ifdef CONFIG_MMU ··· 158 /* 159 * and the usual data section 160 */ 161 - *(.data) 162 CONSTRUCTORS 163 164 _edata = .;
··· 90 __exception_text_start = .; 91 *(.exception.text) 92 __exception_text_end = .; 93 + TEXT_TEXT 94 SCHED_TEXT 95 LOCK_TEXT 96 #ifdef CONFIG_MMU ··· 158 /* 159 * and the usual data section 160 */ 161 + DATA_DATA 162 CONSTRUCTORS 163 164 _edata = .;
+2 -2
arch/arm26/kernel/vmlinux-arm26-xip.lds.in
··· 64 65 .text : { /* Real text segment */ 66 _text = .; /* Text and read-only data */ 67 - *(.text) 68 SCHED_TEXT 69 LOCK_TEXT /* FIXME - borrowed from arm32 - check*/ 70 *(.fixup) ··· 111 /* 112 * and the usual data section 113 */ 114 - *(.data) 115 CONSTRUCTORS 116 117 *(.init.data)
··· 64 65 .text : { /* Real text segment */ 66 _text = .; /* Text and read-only data */ 67 + TEXT_TEXT 68 SCHED_TEXT 69 LOCK_TEXT /* FIXME - borrowed from arm32 - check*/ 70 *(.fixup) ··· 111 /* 112 * and the usual data section 113 */ 114 + DATA_DATA 115 CONSTRUCTORS 116 117 *(.init.data)
+2 -2
arch/arm26/kernel/vmlinux-arm26.lds.in
··· 65 66 .text : { /* Real text segment */ 67 _text = .; /* Text and read-only data */ 68 - *(.text) 69 SCHED_TEXT 70 LOCK_TEXT 71 *(.fixup) ··· 106 /* 107 * and the usual data section 108 */ 109 - *(.data) 110 CONSTRUCTORS 111 112 _edata = .;
··· 65 66 .text : { /* Real text segment */ 67 _text = .; /* Text and read-only data */ 68 + TEXT_TEXT 69 SCHED_TEXT 70 LOCK_TEXT 71 *(.fixup) ··· 106 /* 107 * and the usual data section 108 */ 109 + DATA_DATA 110 CONSTRUCTORS 111 112 _edata = .;
+2 -2
arch/avr32/kernel/vmlinux.lds.c
··· 76 . = 0x100; 77 *(.scall.text) 78 *(.irq.text) 79 - *(.text) 80 SCHED_TEXT 81 LOCK_TEXT 82 KPROBES_TEXT ··· 112 113 /* And the rest... */ 114 *(.data.rel*) 115 - *(.data) 116 CONSTRUCTORS 117 118 _edata = .;
··· 76 . = 0x100; 77 *(.scall.text) 78 *(.irq.text) 79 + TEXT_TEXT 80 SCHED_TEXT 81 LOCK_TEXT 82 KPROBES_TEXT ··· 112 113 /* And the rest... */ 114 *(.data.rel*) 115 + DATA_DATA 116 CONSTRUCTORS 117 118 _edata = .;
+2 -2
arch/blackfin/kernel/vmlinux.lds.S
··· 54 { 55 _text = .; 56 __stext = .; 57 - *(.text) 58 SCHED_TEXT 59 *(.text.lock) 60 . = ALIGN(16); ··· 200 __sdata = .; 201 . = ALIGN(0x2000); 202 *(.data.init_task) 203 - *(.data) 204 205 . = ALIGN(32); 206 *(.data.cacheline_aligned)
··· 54 { 55 _text = .; 56 __stext = .; 57 + TEXT_TEXT 58 SCHED_TEXT 59 *(.text.lock) 60 . = ALIGN(16); ··· 200 __sdata = .; 201 . = ALIGN(0x2000); 202 *(.data.init_task) 203 + DATA_DATA 204 205 . = ALIGN(32); 206 *(.data.cacheline_aligned)
+4 -2
arch/frv/kernel/vmlinux.lds.S
··· 101 _stext = .; 102 .text : { 103 *( 104 - .text.start .text .text.* 105 #ifdef CONFIG_DEBUG_INFO 106 .init.text 107 .exit.text 108 .exitcall.exit 109 #endif 110 ) 111 SCHED_TEXT 112 LOCK_TEXT 113 *(.fixup) ··· 136 137 _sdata = .; 138 .data : { /* Data */ 139 - *(.data .data.*) 140 *(.exit.data) 141 CONSTRUCTORS 142 }
··· 101 _stext = .; 102 .text : { 103 *( 104 + .text.start .text.* 105 #ifdef CONFIG_DEBUG_INFO 106 .init.text 107 .exit.text 108 .exitcall.exit 109 #endif 110 ) 111 + TEXT_TEXT 112 SCHED_TEXT 113 LOCK_TEXT 114 *(.fixup) ··· 135 136 _sdata = .; 137 .data : { /* Data */ 138 + DATA_DATA 139 + *(.data.*) 140 *(.exit.data) 141 CONSTRUCTORS 142 }
+2 -2
arch/h8300/kernel/vmlinux.lds.S
··· 75 *(.int_redirect) 76 #endif 77 __stext = . ; 78 - *(.text) 79 SCHED_TEXT 80 LOCK_TEXT 81 __etext = . ; ··· 103 . = ALIGN(0x2000) ; 104 *(.data.init_task) 105 . = ALIGN(0x4) ; 106 - *(.data) 107 . = ALIGN(0x4) ; 108 *(.data.*) 109
··· 75 *(.int_redirect) 76 #endif 77 __stext = . ; 78 + TEXT_TEXT 79 SCHED_TEXT 80 LOCK_TEXT 81 __etext = . ; ··· 103 . = ALIGN(0x2000) ; 104 *(.data.init_task) 105 . = ALIGN(0x4) ; 106 + DATA_DATA 107 . = ALIGN(0x4) ; 108 *(.data.*) 109
+2 -2
arch/i386/kernel/vmlinux.lds.S
··· 44 45 /* read-only */ 46 .text : AT(ADDR(.text) - LOAD_OFFSET) { 47 - *(.text) 48 SCHED_TEXT 49 LOCK_TEXT 50 KPROBES_TEXT ··· 74 /* writeable */ 75 . = ALIGN(4096); 76 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ 77 - *(.data) 78 CONSTRUCTORS 79 } :data 80
··· 44 45 /* read-only */ 46 .text : AT(ADDR(.text) - LOAD_OFFSET) { 47 + TEXT_TEXT 48 SCHED_TEXT 49 LOCK_TEXT 50 KPROBES_TEXT ··· 74 /* writeable */ 75 . = ALIGN(4096); 76 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ 77 + DATA_DATA 78 CONSTRUCTORS 79 } :data 80
+7 -2
arch/ia64/kernel/vmlinux.lds.S
··· 44 .text : AT(ADDR(.text) - LOAD_OFFSET) 45 { 46 IVT_TEXT 47 - *(.text) 48 SCHED_TEXT 49 LOCK_TEXT 50 KPROBES_TEXT ··· 214 215 data : { } :data 216 .data : AT(ADDR(.data) - LOAD_OFFSET) 217 - { *(.data) *(.data1) *(.gnu.linkonce.d*) CONSTRUCTORS } 218 219 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */ 220 .got : AT(ADDR(.got) - LOAD_OFFSET)
··· 44 .text : AT(ADDR(.text) - LOAD_OFFSET) 45 { 46 IVT_TEXT 47 + TEXT_TEXT 48 SCHED_TEXT 49 LOCK_TEXT 50 KPROBES_TEXT ··· 214 215 data : { } :data 216 .data : AT(ADDR(.data) - LOAD_OFFSET) 217 + { 218 + DATA_DATA 219 + *(.data1) 220 + *(.gnu.linkonce.d*) 221 + CONSTRUCTORS 222 + } 223 224 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */ 225 .got : AT(ADDR(.got) - LOAD_OFFSET)
+2 -2
arch/m32r/kernel/vmlinux.lds.S
··· 27 _text = .; /* Text and read-only data */ 28 .boot : { *(.boot) } = 0 29 .text : { 30 - *(.text) 31 SCHED_TEXT 32 LOCK_TEXT 33 *(.fixup) ··· 50 .data : { /* Data */ 51 *(.spu) 52 *(.spi) 53 - *(.data) 54 CONSTRUCTORS 55 } 56
··· 27 _text = .; /* Text and read-only data */ 28 .boot : { *(.boot) } = 0 29 .text : { 30 + TEXT_TEXT 31 SCHED_TEXT 32 LOCK_TEXT 33 *(.fixup) ··· 50 .data : { /* Data */ 51 *(.spu) 52 *(.spi) 53 + DATA_DATA 54 CONSTRUCTORS 55 } 56
+2 -2
arch/m68k/kernel/vmlinux-std.lds
··· 11 . = 0x1000; 12 _text = .; /* Text and read-only data */ 13 .text : { 14 - *(.text) 15 SCHED_TEXT 16 LOCK_TEXT 17 *(.fixup) ··· 28 _etext = .; /* End of text section */ 29 30 .data : { /* Data */ 31 - *(.data) 32 CONSTRUCTORS 33 } 34
··· 11 . = 0x1000; 12 _text = .; /* Text and read-only data */ 13 .text : { 14 + TEXT_TEXT 15 SCHED_TEXT 16 LOCK_TEXT 17 *(.fixup) ··· 28 _etext = .; /* End of text section */ 29 30 .data : { /* Data */ 31 + DATA_DATA 32 CONSTRUCTORS 33 } 34
+2 -2
arch/m68k/kernel/vmlinux-sun3.lds
··· 12 _text = .; /* Text and read-only data */ 13 .text : { 14 *(.head) 15 - *(.text) 16 SCHED_TEXT 17 LOCK_TEXT 18 *(.fixup) ··· 23 _etext = .; /* End of text section */ 24 25 .data : { /* Data */ 26 - *(.data) 27 CONSTRUCTORS 28 . = ALIGN(16); /* Exception table */ 29 __start___ex_table = .;
··· 12 _text = .; /* Text and read-only data */ 13 .text : { 14 *(.head) 15 + TEXT_TEXT 16 SCHED_TEXT 17 LOCK_TEXT 18 *(.fixup) ··· 23 _etext = .; /* End of text section */ 24 25 .data : { /* Data */ 26 + DATA_DATA 27 CONSTRUCTORS 28 . = ALIGN(16); /* Exception table */ 29 __start___ex_table = .;
+2 -2
arch/m68knommu/kernel/vmlinux.lds.S
··· 62 .text : { 63 _text = .; 64 _stext = . ; 65 - *(.text) 66 SCHED_TEXT 67 *(.text.lock) 68 ··· 133 .data DATA_ADDR : { 134 . = ALIGN(4); 135 _sdata = . ; 136 - *(.data) 137 . = ALIGN(8192) ; 138 *(.data.init_task) 139 _edata = . ;
··· 62 .text : { 63 _text = .; 64 _stext = . ; 65 + TEXT_TEXT 66 SCHED_TEXT 67 *(.text.lock) 68 ··· 133 .data DATA_ADDR : { 134 . = ALIGN(4); 135 _sdata = . ; 136 + DATA_DATA 137 . = ALIGN(8192) ; 138 *(.data.init_task) 139 _edata = . ;
+2 -2
arch/mips/kernel/vmlinux.lds.S
··· 27 /* read-only */ 28 _text = .; /* Text and read-only data */ 29 .text : { 30 - *(.text) 31 SCHED_TEXT 32 LOCK_TEXT 33 *(.fixup) ··· 62 . = ALIGN(_PAGE_SIZE); 63 *(.data.init_task) 64 65 - *(.data) 66 67 CONSTRUCTORS 68 }
··· 27 /* read-only */ 28 _text = .; /* Text and read-only data */ 29 .text : { 30 + TEXT_TEXT 31 SCHED_TEXT 32 LOCK_TEXT 33 *(.fixup) ··· 62 . = ALIGN(_PAGE_SIZE); 63 *(.data.init_task) 64 65 + DATA_DATA 66 67 CONSTRUCTORS 68 }
+2 -2
arch/parisc/kernel/vmlinux.lds.S
··· 51 52 _text = .; /* Text and read-only data */ 53 .text ALIGN(16) : { 54 - *(.text) 55 SCHED_TEXT 56 LOCK_TEXT 57 *(.text.do_softirq) ··· 91 92 . = ALIGN(L1_CACHE_BYTES); 93 .data : { /* Data */ 94 - *(.data) 95 CONSTRUCTORS 96 } 97
··· 51 52 _text = .; /* Text and read-only data */ 53 .text ALIGN(16) : { 54 + TEXT_TEXT 55 SCHED_TEXT 56 LOCK_TEXT 57 *(.text.do_softirq) ··· 91 92 . = ALIGN(L1_CACHE_BYTES); 93 .data : { /* Data */ 94 + DATA_DATA 95 CONSTRUCTORS 96 } 97
+3 -2
arch/powerpc/kernel/vmlinux.lds.S
··· 34 /* Text and gots */ 35 .text : { 36 _text = .; 37 - *(.text .text.*) 38 SCHED_TEXT 39 LOCK_TEXT 40 KPROBES_TEXT ··· 168 #ifdef CONFIG_PPC32 169 .data : 170 { 171 - *(.data) 172 *(.sdata) 173 *(.got.plt) *(.got) 174 }
··· 34 /* Text and gots */ 35 .text : { 36 _text = .; 37 + *(.text.*) 38 + TEXT_TEXT 39 SCHED_TEXT 40 LOCK_TEXT 41 KPROBES_TEXT ··· 167 #ifdef CONFIG_PPC32 168 .data : 169 { 170 + DATA_DATA 171 *(.sdata) 172 *(.got.plt) *(.got) 173 }
+2 -2
arch/ppc/kernel/vmlinux.lds.S
··· 32 .text : 33 { 34 _text = .; 35 - *(.text) 36 SCHED_TEXT 37 LOCK_TEXT 38 *(.fixup) ··· 67 . = ALIGN(4096); 68 .data : 69 { 70 - *(.data) 71 *(.data1) 72 *(.sdata) 73 *(.sdata2)
··· 32 .text : 33 { 34 _text = .; 35 + TEXT_TEXT 36 SCHED_TEXT 37 LOCK_TEXT 38 *(.fixup) ··· 67 . = ALIGN(4096); 68 .data : 69 { 70 + DATA_DATA 71 *(.data1) 72 *(.sdata) 73 *(.sdata2)
+2 -2
arch/s390/kernel/vmlinux.lds.S
··· 21 . = 0x00000000; 22 _text = .; /* Text and read-only data */ 23 .text : { 24 - *(.text) 25 SCHED_TEXT 26 LOCK_TEXT 27 KPROBES_TEXT ··· 48 BUG_TABLE 49 50 .data : { /* Data */ 51 - *(.data) 52 CONSTRUCTORS 53 } 54
··· 21 . = 0x00000000; 22 _text = .; /* Text and read-only data */ 23 .text : { 24 + TEXT_TEXT 25 SCHED_TEXT 26 LOCK_TEXT 27 KPROBES_TEXT ··· 48 BUG_TABLE 49 50 .data : { /* Data */ 51 + DATA_DATA 52 CONSTRUCTORS 53 } 54
+2 -2
arch/sh/kernel/vmlinux.lds.S
··· 22 *(.empty_zero_page) 23 } = 0 24 .text : { 25 - *(.text) 26 SCHED_TEXT 27 LOCK_TEXT 28 *(.fixup) ··· 41 BUG_TABLE 42 43 .data : { /* Data */ 44 - *(.data) 45 46 /* Align the initial ramdisk image (INITRD) on page boundaries. */ 47 . = ALIGN(PAGE_SIZE);
··· 22 *(.empty_zero_page) 23 } = 0 24 .text : { 25 + TEXT_TEXT 26 SCHED_TEXT 27 LOCK_TEXT 28 *(.fixup) ··· 41 BUG_TABLE 42 43 .data : { /* Data */ 44 + DATA_DATA 45 46 /* Align the initial ramdisk image (INITRD) on page boundaries. */ 47 . = ALIGN(PAGE_SIZE);
+2 -2
arch/sh64/kernel/vmlinux.lds.S
··· 54 } = 0 55 56 .text : C_PHYS(.text) { 57 - *(.text) 58 *(.text64) 59 *(.text..SHmedia32) 60 SCHED_TEXT ··· 78 _etext = .; /* End of text section */ 79 80 .data : C_PHYS(.data) { /* Data */ 81 - *(.data) 82 CONSTRUCTORS 83 } 84
··· 54 } = 0 55 56 .text : C_PHYS(.text) { 57 + TEXT_TEXT 58 *(.text64) 59 *(.text..SHmedia32) 60 SCHED_TEXT ··· 78 _etext = .; /* End of text section */ 79 80 .data : C_PHYS(.data) { /* Data */ 81 + DATA_DATA 82 CONSTRUCTORS 83 } 84
+2 -2
arch/sparc/kernel/vmlinux.lds.S
··· 12 .text 0xf0004000 : 13 { 14 _text = .; 15 - *(.text) 16 SCHED_TEXT 17 LOCK_TEXT 18 *(.gnu.warning) ··· 22 RODATA 23 .data : 24 { 25 - *(.data) 26 CONSTRUCTORS 27 } 28 .data1 : { *(.data1) }
··· 12 .text 0xf0004000 : 13 { 14 _text = .; 15 + TEXT_TEXT 16 SCHED_TEXT 17 LOCK_TEXT 18 *(.gnu.warning) ··· 22 RODATA 23 .data : 24 { 25 + DATA_DATA 26 CONSTRUCTORS 27 } 28 .data1 : { *(.data1) }
+2 -2
arch/sparc64/kernel/vmlinux.lds.S
··· 14 .text 0x0000000000404000 : 15 { 16 _text = .; 17 - *(.text) 18 SCHED_TEXT 19 LOCK_TEXT 20 KPROBES_TEXT ··· 27 28 .data : 29 { 30 - *(.data) 31 CONSTRUCTORS 32 } 33 .data1 : { *(.data1) }
··· 14 .text 0x0000000000404000 : 15 { 16 _text = .; 17 + TEXT_TEXT 18 SCHED_TEXT 19 LOCK_TEXT 20 KPROBES_TEXT ··· 27 28 .data : 29 { 30 + DATA_DATA 31 CONSTRUCTORS 32 } 33 .data1 : { *(.data1) }
+3 -2
arch/um/kernel/dyn.lds.S
··· 62 } =0x90909090 63 .plt : { *(.plt) } 64 .text : { 65 - *(.text) 66 SCHED_TEXT 67 LOCK_TEXT 68 *(.fixup) ··· 99 *(.data.init_task) 100 . = ALIGN(KERNEL_STACK_SIZE); 101 *(.data.init_irqstack) 102 - *(.data .data.* .gnu.linkonce.d.*) 103 SORT(CONSTRUCTORS) 104 } 105 .data1 : { *(.data1) }
··· 62 } =0x90909090 63 .plt : { *(.plt) } 64 .text : { 65 + TEXT_TEXT 66 SCHED_TEXT 67 LOCK_TEXT 68 *(.fixup) ··· 99 *(.data.init_task) 100 . = ALIGN(KERNEL_STACK_SIZE); 101 *(.data.init_irqstack) 102 + DATA_DATA 103 + *(.data.* .gnu.linkonce.d.*) 104 SORT(CONSTRUCTORS) 105 } 106 .data1 : { *(.data1) }
+2 -2
arch/um/kernel/uml.lds.S
··· 37 38 .text : 39 { 40 - *(.text) 41 SCHED_TEXT 42 LOCK_TEXT 43 *(.fixup) ··· 61 *(.data.init_task) 62 . = ALIGN(KERNEL_STACK_SIZE); 63 *(.data.init_irqstack) 64 - *(.data) 65 *(.gnu.linkonce.d*) 66 CONSTRUCTORS 67 }
··· 37 38 .text : 39 { 40 + TEXT_TEXT 41 SCHED_TEXT 42 LOCK_TEXT 43 *(.fixup) ··· 61 *(.data.init_task) 62 . = ALIGN(KERNEL_STACK_SIZE); 63 *(.data.init_irqstack) 64 + DATA_DATA 65 *(.gnu.linkonce.d*) 66 CONSTRUCTORS 67 }
+2 -2
arch/v850/kernel/vmlinux.lds.S
··· 92 #define TEXT_CONTENTS \ 93 _text = .; \ 94 __stext = . ; \ 95 - *(.text) \ 96 SCHED_TEXT \ 97 *(.exit.text) /* 2.5 convention */ \ 98 *(.text.exit) /* 2.4 convention */ \ ··· 113 /* Kernel data segment. */ 114 #define DATA_CONTENTS \ 115 __sdata = . ; \ 116 - *(.data) \ 117 *(.exit.data) /* 2.5 convention */ \ 118 *(.data.exit) /* 2.4 convention */ \ 119 . = ALIGN (16) ; \
··· 92 #define TEXT_CONTENTS \ 93 _text = .; \ 94 __stext = . ; \ 95 + TEXT_TEXT \ 96 SCHED_TEXT \ 97 *(.exit.text) /* 2.5 convention */ \ 98 *(.text.exit) /* 2.4 convention */ \ ··· 113 /* Kernel data segment. */ 114 #define DATA_CONTENTS \ 115 __sdata = . ; \ 116 + DATA_DATA \ 117 *(.exit.data) /* 2.5 convention */ \ 118 *(.data.exit) /* 2.4 convention */ \ 119 . = ALIGN (16) ; \
+2 -2
arch/x86_64/kernel/vmlinux.lds.S
··· 31 *(.bootstrap.text) 32 _stext = .; 33 /* Then the rest */ 34 - *(.text) 35 SCHED_TEXT 36 LOCK_TEXT 37 KPROBES_TEXT ··· 55 . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ 56 /* Data */ 57 .data : AT(ADDR(.data) - LOAD_OFFSET) { 58 - *(.data) 59 CONSTRUCTORS 60 } :data 61
··· 31 *(.bootstrap.text) 32 _stext = .; 33 /* Then the rest */ 34 + TEXT_TEXT 35 SCHED_TEXT 36 LOCK_TEXT 37 KPROBES_TEXT ··· 55 . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ 56 /* Data */ 57 .data : AT(ADDR(.data) - LOAD_OFFSET) { 58 + DATA_DATA 59 CONSTRUCTORS 60 } :data 61
+4 -2
arch/xtensa/kernel/vmlinux.lds.S
··· 84 { 85 /* The .head.text section must be the first section! */ 86 *(.head.text) 87 - *(.literal .text) 88 *(.srom.text) 89 VMLINUX_SYMBOL(__sched_text_start) = .; 90 *(.sched.literal .sched.text) ··· 145 _fdata = .; 146 .data : 147 { 148 - *(.data) CONSTRUCTORS 149 . = ALIGN(XCHAL_ICACHE_LINESIZE); 150 *(.data.cacheline_aligned) 151 }
··· 84 { 85 /* The .head.text section must be the first section! */ 86 *(.head.text) 87 + *(.literal) 88 + TEXT_TEXT 89 *(.srom.text) 90 VMLINUX_SYMBOL(__sched_text_start) = .; 91 *(.sched.literal .sched.text) ··· 144 _fdata = .; 145 .data : 146 { 147 + DATA_DATA 148 + CONSTRUCTORS 149 . = ALIGN(XCHAL_ICACHE_LINESIZE); 150 *(.data.cacheline_aligned) 151 }
+12
include/asm-generic/vmlinux.lds.h
··· 9 /* Align . to a 8 byte boundary equals to maximum function alignment. */ 10 #define ALIGN_FUNCTION() . = ALIGN(8) 11 12 #define RODATA \ 13 . = ALIGN(4096); \ 14 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ ··· 143 *(.security_initcall.init) \ 144 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 145 } 146 147 /* sched.text is aling to function alignment to secure we have same 148 * address even at second ld pass when generating System.map */
··· 9 /* Align . to a 8 byte boundary equals to maximum function alignment. */ 10 #define ALIGN_FUNCTION() . = ALIGN(8) 11 12 + /* .data section */ 13 + #define DATA_DATA \ 14 + *(.data) \ 15 + *(.data.init.refok) 16 + 17 #define RODATA \ 18 . = ALIGN(4096); \ 19 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ ··· 138 *(.security_initcall.init) \ 139 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 140 } 141 + 142 + /* .text section. Map to function alignment to avoid address changes 143 + * during second ld run in second ld pass when generating System.map */ 144 + #define TEXT_TEXT \ 145 + ALIGN_FUNCTION(); \ 146 + *(.text) \ 147 + *(.text.init.refok) 148 149 /* sched.text is aling to function alignment to secure we have same 150 * address even at second ld pass when generating System.map */
+13
include/linux/init.h
··· 45 #define __exitdata __attribute__ ((__section__(".exit.data"))) 46 #define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) 47 48 #ifdef MODULE 49 #define __exit __attribute__ ((__section__(".exit.text"))) 50 #else
··· 45 #define __exitdata __attribute__ ((__section__(".exit.data"))) 46 #define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) 47 48 + /* modpost check for section mismatches during the kernel build. 49 + * A section mismatch happens when there are references from a 50 + * code or data section to an init section (both code or data). 51 + * The init sections are (for most archs) discarded by the kernel 52 + * when early init has completed so all such references are potential bugs. 53 + * For exit sections the same issue exists. 54 + * The following markers are used for the cases where the reference to 55 + * the init/exit section (code or data) is valid and will teach modpost 56 + * not to issue a warning. 57 + * The markers follow same syntax rules as __init / __initdata. */ 58 + #define __init_refok noinline __attribute__ ((__section__ (".text.init.refok"))) 59 + #define __initdata_refok __attribute__ ((__section__ (".data.init.refok"))) 60 + 61 #ifdef MODULE 62 #define __exit __attribute__ ((__section__(".exit.text"))) 63 #else
+1 -1
init/main.c
··· 423 * gcc-3.4 accidentally inlines this function, so use noinline. 424 */ 425 426 - static void noinline rest_init(void) 427 __releases(kernel_lock) 428 { 429 int pid;
··· 423 * gcc-3.4 accidentally inlines this function, so use noinline. 424 */ 425 426 + static void noinline __init_refok rest_init(void) 427 __releases(kernel_lock) 428 { 429 int pid;
+2 -2
mm/page_alloc.c
··· 2165 2166 #endif 2167 2168 - static __meminit noinline 2169 int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages) 2170 { 2171 int i; ··· 2678 } 2679 } 2680 2681 - static void __meminit alloc_node_mem_map(struct pglist_data *pgdat) 2682 { 2683 /* Skip empty nodes */ 2684 if (!pgdat->node_spanned_pages)
··· 2165 2166 #endif 2167 2168 + static noinline __init_refok 2169 int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages) 2170 { 2171 int i; ··· 2678 } 2679 } 2680 2681 + static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) 2682 { 2683 /* Skip empty nodes */ 2684 if (!pgdat->node_spanned_pages)
+1 -1
mm/slab.c
··· 2037 return left_over; 2038 } 2039 2040 - static int setup_cpu_cache(struct kmem_cache *cachep) 2041 { 2042 if (g_cpucache_up == FULL) 2043 return enable_cpucache(cachep);
··· 2037 return left_over; 2038 } 2039 2040 + static int __init_refok setup_cpu_cache(struct kmem_cache *cachep) 2041 { 2042 if (g_cpucache_up == FULL) 2043 return enable_cpucache(cachep);
+1 -1
mm/sparse.c
··· 44 #endif 45 46 #ifdef CONFIG_SPARSEMEM_EXTREME 47 - static struct mem_section noinline *sparse_index_alloc(int nid) 48 { 49 struct mem_section *section = NULL; 50 unsigned long array_size = SECTIONS_PER_ROOT *
··· 44 #endif 45 46 #ifdef CONFIG_SPARSEMEM_EXTREME 47 + static struct mem_section noinline __init_refok *sparse_index_alloc(int nid) 48 { 49 struct mem_section *section = NULL; 50 unsigned long array_size = SECTIONS_PER_ROOT *
+9 -15
scripts/kconfig/lxdialog/check-lxdialog.sh
··· 4 # What library to link 5 ldflags() 6 { 7 - $cc -print-file-name=libncursesw.so | grep -q / 8 - if [ $? -eq 0 ]; then 9 - echo '-lncursesw' 10 - exit 11 - fi 12 - $cc -print-file-name=libncurses.so | grep -q / 13 - if [ $? -eq 0 ]; then 14 - echo '-lncurses' 15 - exit 16 - fi 17 - $cc -print-file-name=libcurses.so | grep -q / 18 - if [ $? -eq 0 ]; then 19 - echo '-lcurses' 20 - exit 21 - fi 22 exit 1 23 } 24
··· 4 # What library to link 5 ldflags() 6 { 7 + for ext in so a dylib ; do 8 + for lib in ncursesw ncurses curses ; do 9 + $cc -print-file-name=lib${lib}.${ext} | grep -q / 10 + if [ $? -eq 0 ]; then 11 + echo "-l${lib}" 12 + exit 13 + fi 14 + done 15 + done 16 exit 1 17 } 18
+8 -3
scripts/mod/file2alias.c
··· 353 354 static int do_of_entry (const char *filename, struct of_device_id *of, char *alias) 355 { 356 char *tmp; 357 - sprintf (alias, "of:N%sT%sC%s", 358 of->name[0] ? of->name : "*", 359 - of->type[0] ? of->type : "*", 360 - of->compatible[0] ? of->compatible : "*"); 361 362 /* Replace all whitespace with underscores */ 363 for (tmp = alias; tmp && *tmp; tmp++)
··· 353 354 static int do_of_entry (const char *filename, struct of_device_id *of, char *alias) 355 { 356 + int len; 357 char *tmp; 358 + len = sprintf (alias, "of:N%sT%s", 359 of->name[0] ? of->name : "*", 360 + of->type[0] ? of->type : "*"); 361 + 362 + if (of->compatible[0]) 363 + sprintf (&alias[len], "%sC%s", 364 + of->type[0] ? "*" : "", 365 + of->compatible); 366 367 /* Replace all whitespace with underscores */ 368 for (tmp = alias; tmp && *tmp; tmp++)
+116 -53
scripts/mod/modpost.c
··· 384 sechdrs[i].sh_size = TO_NATIVE(sechdrs[i].sh_size); 385 sechdrs[i].sh_link = TO_NATIVE(sechdrs[i].sh_link); 386 sechdrs[i].sh_name = TO_NATIVE(sechdrs[i].sh_name); 387 } 388 /* Find symbol table. */ 389 for (i = 1; i < hdr->e_shnum; i++) { ··· 583 584 /** 585 * Whitelist to allow certain references to pass with no warning. 586 * Pattern 1: 587 * If a module parameter is declared __initdata and permissions=0 588 * then this is legal despite the warning generated. ··· 626 * This pattern is identified by 627 * refsymname = __init_begin, _sinittext, _einittext 628 * 629 - * Pattern 6: 630 - * During the early init phase we have references from .init.text to 631 - * .text we have an intended section mismatch - do not warn about it. 632 - * See kernel_init() in init/main.c 633 - * tosec = .init.text 634 - * fromsec = .text 635 - * atsym = kernel_init 636 - * 637 * Pattern 7: 638 * Logos used in drivers/video/logo reside in __initdata but the 639 * funtion that references them are EXPORT_SYMBOL() so cannot be ··· 641 * tosec = .init.text 642 * fromsec = .paravirtprobe 643 * 644 - * Pattern 9: 645 - * Some of functions are common code between boot time and hotplug 646 - * time. The bootmem allocater is called only boot time in its 647 - * functions. So it's ok to reference. 648 - * tosec = .init.text 649 - * 650 * Pattern 10: 651 - * ia64 has machvec table for each platform. It is mixture of function 652 - * pointer of .init.text and .text. 653 - * fromsec = .machvec 654 **/ 655 static int secref_whitelist(const char *modname, const char *tosec, 656 const char *fromsec, const char *atsym, ··· 672 NULL 673 }; 674 675 - const char *pat4sym[] = { 676 - "sparse_index_alloc", 677 - "zone_wait_table_init", 678 - NULL 679 - }; 680 681 /* Check for pattern 1 */ 682 if (strcmp(tosec, ".init.data") != 0) ··· 718 if (strcmp(refsymname, *s) == 0) 719 return 1; 720 721 - /* Check for pattern 6 */ 722 - if ((strcmp(tosec, ".init.text") == 0) && 723 - (strcmp(fromsec, ".text") == 0) && 724 - (strcmp(refsymname, "kernel_init") == 0)) 725 - return 1; 726 - 727 /* Check for pattern 7 */ 728 if ((strcmp(tosec, ".init.data") == 0) && 729 (strncmp(fromsec, ".text", strlen(".text")) == 0) && ··· 729 (strcmp(fromsec, ".paravirtprobe") == 0)) 730 return 1; 731 732 - /* Check for pattern 9 */ 733 - if ((strcmp(tosec, ".init.text") == 0) && 734 - (strcmp(fromsec, ".text") == 0)) 735 - for (s = pat4sym; *s; s++) 736 - if (strcmp(atsym, *s) == 0) 737 - return 1; 738 - 739 /* Check for pattern 10 */ 740 - if (strcmp(fromsec, ".machvec") == 0) 741 return 1; 742 743 return 0; ··· 753 return relsym; 754 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { 755 if (sym->st_shndx != relsym->st_shndx) 756 continue; 757 if (sym->st_value == addr) 758 return sym; ··· 867 elf->strtab + before->st_name, refsymname)) 868 return; 869 870 if (before && after) { 871 - warn("%s - Section mismatch: reference to %s:%s from %s " 872 - "between '%s' (at offset 0x%llx) and '%s'\n", 873 - modname, secname, refsymname, fromsec, 874 elf->strtab + before->st_name, 875 - (long long)r.r_offset, 876 elf->strtab + after->st_name); 877 } else if (before) { 878 - warn("%s - Section mismatch: reference to %s:%s from %s " 879 - "after '%s' (at offset 0x%llx)\n", 880 - modname, secname, refsymname, fromsec, 881 - elf->strtab + before->st_name, 882 - (long long)r.r_offset); 883 } else if (after) { 884 - warn("%s - Section mismatch: reference to %s:%s from %s " 885 "before '%s' (at offset -0x%llx)\n", 886 - modname, secname, refsymname, fromsec, 887 - elf->strtab + after->st_name, 888 - (long long)r.r_offset); 889 } else { 890 - warn("%s - Section mismatch: reference to %s:%s from %s " 891 - "(offset 0x%llx)\n", 892 - modname, secname, fromsec, refsymname, 893 - (long long)r.r_offset); 894 } 895 } 896 897 /** ··· 1003 r.r_offset = TO_NATIVE(rela->r_offset); 1004 #if KERNEL_ELFCLASS == ELFCLASS64 1005 if (hdr->e_machine == EM_MIPS) { 1006 r_sym = ELF64_MIPS_R_SYM(rela->r_info); 1007 r_sym = TO_NATIVE(r_sym); 1008 } else { 1009 r.r_info = TO_NATIVE(rela->r_info); 1010 r_sym = ELF_R_SYM(r.r_info); ··· 1040 r.r_offset = TO_NATIVE(rel->r_offset); 1041 #if KERNEL_ELFCLASS == ELFCLASS64 1042 if (hdr->e_machine == EM_MIPS) { 1043 r_sym = ELF64_MIPS_R_SYM(rel->r_info); 1044 r_sym = TO_NATIVE(r_sym); 1045 } else { 1046 r.r_info = TO_NATIVE(rel->r_info); 1047 r_sym = ELF_R_SYM(r.r_info); ··· 1054 r_sym = ELF_R_SYM(r.r_info); 1055 #endif 1056 r.r_addend = 0; 1057 sym = elf->symtab_start + r_sym; 1058 /* Skip special sections */ 1059 if (sym->st_shndx >= SHN_LORESERVE)
··· 384 sechdrs[i].sh_size = TO_NATIVE(sechdrs[i].sh_size); 385 sechdrs[i].sh_link = TO_NATIVE(sechdrs[i].sh_link); 386 sechdrs[i].sh_name = TO_NATIVE(sechdrs[i].sh_name); 387 + sechdrs[i].sh_info = TO_NATIVE(sechdrs[i].sh_info); 388 } 389 /* Find symbol table. */ 390 for (i = 1; i < hdr->e_shnum; i++) { ··· 582 583 /** 584 * Whitelist to allow certain references to pass with no warning. 585 + * 586 + * Pattern 0: 587 + * Do not warn if funtion/data are marked with __init_refok/__initdata_refok. 588 + * The pattern is identified by: 589 + * fromsec = .text.init.refok | .data.init.refok 590 + * 591 * Pattern 1: 592 * If a module parameter is declared __initdata and permissions=0 593 * then this is legal despite the warning generated. ··· 619 * This pattern is identified by 620 * refsymname = __init_begin, _sinittext, _einittext 621 * 622 * Pattern 7: 623 * Logos used in drivers/video/logo reside in __initdata but the 624 * funtion that references them are EXPORT_SYMBOL() so cannot be ··· 642 * tosec = .init.text 643 * fromsec = .paravirtprobe 644 * 645 * Pattern 10: 646 + * ia64 has machvec table for each platform and 647 + * powerpc has a machine desc table for each platform. 648 + * It is mixture of function pointers of .init.text and .text. 649 + * fromsec = .machvec | .machine.desc 650 **/ 651 static int secref_whitelist(const char *modname, const char *tosec, 652 const char *fromsec, const char *atsym, ··· 678 NULL 679 }; 680 681 + /* Check for pattern 0 */ 682 + if ((strcmp(fromsec, ".text.init.refok") == 0) || 683 + (strcmp(fromsec, ".data.init.refok") == 0)) 684 + return 1; 685 686 /* Check for pattern 1 */ 687 if (strcmp(tosec, ".init.data") != 0) ··· 725 if (strcmp(refsymname, *s) == 0) 726 return 1; 727 728 /* Check for pattern 7 */ 729 if ((strcmp(tosec, ".init.data") == 0) && 730 (strncmp(fromsec, ".text", strlen(".text")) == 0) && ··· 742 (strcmp(fromsec, ".paravirtprobe") == 0)) 743 return 1; 744 745 /* Check for pattern 10 */ 746 + if ((strcmp(fromsec, ".machvec") == 0) || 747 + (strcmp(fromsec, ".machine.desc") == 0)) 748 return 1; 749 750 return 0; ··· 772 return relsym; 773 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { 774 if (sym->st_shndx != relsym->st_shndx) 775 + continue; 776 + if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) 777 continue; 778 if (sym->st_value == addr) 779 return sym; ··· 884 elf->strtab + before->st_name, refsymname)) 885 return; 886 887 + /* fromsec whitelist - without a valid 'before' 888 + * powerpc has a GOT table in .got2 section */ 889 + if (strcmp(fromsec, ".got2") == 0) 890 + return; 891 + 892 if (before && after) { 893 + warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s " 894 + "(between '%s' and '%s')\n", 895 + modname, fromsec, (unsigned long long)r.r_offset, 896 + secname, refsymname, 897 elf->strtab + before->st_name, 898 elf->strtab + after->st_name); 899 } else if (before) { 900 + warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s " 901 + "(after '%s')\n", 902 + modname, fromsec, (unsigned long long)r.r_offset, 903 + secname, refsymname, 904 + elf->strtab + before->st_name); 905 } else if (after) { 906 + warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s " 907 "before '%s' (at offset -0x%llx)\n", 908 + modname, fromsec, (unsigned long long)r.r_offset, 909 + secname, refsymname, 910 + elf->strtab + after->st_name); 911 } else { 912 + warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s\n", 913 + modname, fromsec, (unsigned long long)r.r_offset, 914 + secname, refsymname); 915 } 916 + } 917 + 918 + static void addend_386_rel(struct elf_info *elf, int section, Elf_Rela *r) 919 + { 920 + Elf_Shdr *sechdrs = elf->sechdrs; 921 + unsigned int r_typ; 922 + unsigned int *location; 923 + 924 + r_typ = ELF_R_TYPE(r->r_info); 925 + location = (void *)elf->hdr + 926 + sechdrs[sechdrs[section].sh_info].sh_offset + r->r_offset; 927 + switch (r_typ) { 928 + case R_386_32: 929 + r->r_addend = TO_NATIVE(*location); 930 + break; 931 + case R_386_PC32: 932 + r->r_addend = TO_NATIVE(*location) + 4; 933 + break; 934 + } 935 + } 936 + 937 + static void addend_arm_rel(struct elf_info *elf, int section, Elf_Rela *r) 938 + { 939 + Elf_Shdr *sechdrs = elf->sechdrs; 940 + unsigned int r_typ; 941 + unsigned int *location; 942 + 943 + r_typ = ELF_R_TYPE(r->r_info); 944 + location = (void *)elf->hdr + 945 + sechdrs[sechdrs[section].sh_info].sh_offset + r->r_offset; 946 + switch (r_typ) { 947 + case R_ARM_ABS32: 948 + r->r_addend = TO_NATIVE(*location); 949 + break; 950 + case R_ARM_PC24: 951 + r->r_addend = ((TO_NATIVE(*location) & 0x00ffffff) << 2) + 8; 952 + break; 953 + } 954 + } 955 + 956 + static int addend_mips_rel(struct elf_info *elf, int section, Elf_Rela *r) 957 + { 958 + Elf_Shdr *sechdrs = elf->sechdrs; 959 + unsigned int r_typ; 960 + unsigned int *location; 961 + unsigned int inst; 962 + 963 + r_typ = ELF_R_TYPE(r->r_info); 964 + if (r_typ == R_MIPS_HI16) 965 + return 1; /* skip this */ 966 + location = (void *)elf->hdr + 967 + sechdrs[sechdrs[section].sh_info].sh_offset + r->r_offset; 968 + inst = TO_NATIVE(*location); 969 + switch (r_typ) { 970 + case R_MIPS_LO16: 971 + r->r_addend = ((inst & 0xffff) ^ 0x8000) - 0x8000; 972 + break; 973 + case R_MIPS_26: 974 + r->r_addend = (inst & 0x03ffffff) << 2; 975 + break; 976 + } 977 + return 0; 978 } 979 980 /** ··· 954 r.r_offset = TO_NATIVE(rela->r_offset); 955 #if KERNEL_ELFCLASS == ELFCLASS64 956 if (hdr->e_machine == EM_MIPS) { 957 + unsigned int r_typ; 958 r_sym = ELF64_MIPS_R_SYM(rela->r_info); 959 r_sym = TO_NATIVE(r_sym); 960 + r_typ = ELF64_MIPS_R_TYPE(rela->r_info); 961 + r.r_info = ELF64_R_INFO(r_sym, r_typ); 962 } else { 963 r.r_info = TO_NATIVE(rela->r_info); 964 r_sym = ELF_R_SYM(r.r_info); ··· 988 r.r_offset = TO_NATIVE(rel->r_offset); 989 #if KERNEL_ELFCLASS == ELFCLASS64 990 if (hdr->e_machine == EM_MIPS) { 991 + unsigned int r_typ; 992 r_sym = ELF64_MIPS_R_SYM(rel->r_info); 993 r_sym = TO_NATIVE(r_sym); 994 + r_typ = ELF64_MIPS_R_TYPE(rel->r_info); 995 + r.r_info = ELF64_R_INFO(r_sym, r_typ); 996 } else { 997 r.r_info = TO_NATIVE(rel->r_info); 998 r_sym = ELF_R_SYM(r.r_info); ··· 999 r_sym = ELF_R_SYM(r.r_info); 1000 #endif 1001 r.r_addend = 0; 1002 + if (hdr->e_machine == EM_386) 1003 + addend_386_rel(elf, i, &r); 1004 + else if (hdr->e_machine == EM_ARM) 1005 + addend_arm_rel(elf, i, &r); 1006 + else if (hdr->e_machine == EM_MIPS) { 1007 + if (addend_mips_rel(elf, i, &r)) 1008 + continue; 1009 + } 1010 sym = elf->symtab_start + r_sym; 1011 /* Skip special sections */ 1012 if (sym->st_shndx >= SHN_LORESERVE)
+3
scripts/mod/modpost.h
··· 60 #define ELF64_MIPS_R_SYM(i) \ 61 ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) 62 63 #if KERNEL_ELFDATA != HOST_ELFDATA 64 65 static inline void __endian(const void *src, void *dest, unsigned int size)
··· 60 #define ELF64_MIPS_R_SYM(i) \ 61 ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) 62 63 + #define ELF64_MIPS_R_TYPE(i) \ 64 + ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_type1) 65 + 66 #if KERNEL_ELFDATA != HOST_ELFDATA 67 68 static inline void __endian(const void *src, void *dest, unsigned int size)
+1
scripts/mod/sumversion.c
··· 7 #include <ctype.h> 8 #include <errno.h> 9 #include <string.h> 10 #include "modpost.h" 11 12 /*
··· 7 #include <ctype.h> 8 #include <errno.h> 9 #include <string.h> 10 + #include <limits.h> 11 #include "modpost.h" 12 13 /*