aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-21 15:03:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-21 15:03:04 -0400
commit080e89270a7bfb7d01fac9a67050f8ac6d6cdd11 (patch)
tree489e467292ca06420e85f185095323efb80c75b7
parent4b85df0419d1fb135d9d845876e8c7ee1393f83c (diff)
parent38bdc32af442b6ab09ed61b8b669072098c95dd2 (diff)
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
-rw-r--r--arch/alpha/kernel/vmlinux.lds.S4
-rw-r--r--arch/arm/kernel/vmlinux.lds.S4
-rw-r--r--arch/arm26/kernel/vmlinux-arm26-xip.lds.in4
-rw-r--r--arch/arm26/kernel/vmlinux-arm26.lds.in4
-rw-r--r--arch/avr32/kernel/vmlinux.lds.c4
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S4
-rw-r--r--arch/frv/kernel/vmlinux.lds.S6
-rw-r--r--arch/h8300/kernel/vmlinux.lds.S4
-rw-r--r--arch/i386/kernel/vmlinux.lds.S4
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S9
-rw-r--r--arch/m32r/kernel/vmlinux.lds.S4
-rw-r--r--arch/m68k/kernel/vmlinux-std.lds4
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds4
-rw-r--r--arch/m68knommu/kernel/vmlinux.lds.S4
-rw-r--r--arch/mips/kernel/vmlinux.lds.S4
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S4
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S5
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S4
-rw-r--r--arch/s390/kernel/vmlinux.lds.S4
-rw-r--r--arch/sh/kernel/vmlinux.lds.S4
-rw-r--r--arch/sh64/kernel/vmlinux.lds.S4
-rw-r--r--arch/sparc/kernel/vmlinux.lds.S4
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S4
-rw-r--r--arch/um/kernel/dyn.lds.S5
-rw-r--r--arch/um/kernel/uml.lds.S4
-rw-r--r--arch/v850/kernel/vmlinux.lds.S4
-rw-r--r--arch/x86_64/kernel/vmlinux.lds.S4
-rw-r--r--arch/xtensa/kernel/vmlinux.lds.S6
-rw-r--r--include/asm-generic/vmlinux.lds.h12
-rw-r--r--include/linux/init.h13
-rw-r--r--init/main.c2
-rw-r--r--mm/page_alloc.c4
-rw-r--r--mm/slab.c2
-rw-r--r--mm/sparse.c2
-rw-r--r--scripts/kconfig/lxdialog/check-lxdialog.sh24
-rw-r--r--scripts/mod/file2alias.c11
-rw-r--r--scripts/mod/modpost.c169
-rw-r--r--scripts/mod/modpost.h3
-rw-r--r--scripts/mod/sumversion.c1
39 files changed, 234 insertions, 132 deletions
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index cf1e6fc6c686..449e76f118d3 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -15,7 +15,7 @@ SECTIONS
15 15
16 _text = .; /* Text and read-only data */ 16 _text = .; /* Text and read-only data */
17 .text : { 17 .text : {
18 *(.text) 18 TEXT_TEXT
19 SCHED_TEXT 19 SCHED_TEXT
20 LOCK_TEXT 20 LOCK_TEXT
21 *(.fixup) 21 *(.fixup)
@@ -89,7 +89,7 @@ SECTIONS
89 89
90 _data = .; 90 _data = .;
91 .data : { /* Data */ 91 .data : { /* Data */
92 *(.data) 92 DATA_DATA
93 CONSTRUCTORS 93 CONSTRUCTORS
94 } 94 }
95 95
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index e4156e7868ce..2b7a8f5d8cf2 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -90,7 +90,7 @@ SECTIONS
90 __exception_text_start = .; 90 __exception_text_start = .;
91 *(.exception.text) 91 *(.exception.text)
92 __exception_text_end = .; 92 __exception_text_end = .;
93 *(.text) 93 TEXT_TEXT
94 SCHED_TEXT 94 SCHED_TEXT
95 LOCK_TEXT 95 LOCK_TEXT
96#ifdef CONFIG_MMU 96#ifdef CONFIG_MMU
@@ -158,7 +158,7 @@ SECTIONS
158 /* 158 /*
159 * and the usual data section 159 * and the usual data section
160 */ 160 */
161 *(.data) 161 DATA_DATA
162 CONSTRUCTORS 162 CONSTRUCTORS
163 163
164 _edata = .; 164 _edata = .;
diff --git a/arch/arm26/kernel/vmlinux-arm26-xip.lds.in b/arch/arm26/kernel/vmlinux-arm26-xip.lds.in
index 046a85054018..4ec715c25dea 100644
--- a/arch/arm26/kernel/vmlinux-arm26-xip.lds.in
+++ b/arch/arm26/kernel/vmlinux-arm26-xip.lds.in
@@ -64,7 +64,7 @@ SECTIONS
64 64
65 .text : { /* Real text segment */ 65 .text : { /* Real text segment */
66 _text = .; /* Text and read-only data */ 66 _text = .; /* Text and read-only data */
67 *(.text) 67 TEXT_TEXT
68 SCHED_TEXT 68 SCHED_TEXT
69 LOCK_TEXT /* FIXME - borrowed from arm32 - check*/ 69 LOCK_TEXT /* FIXME - borrowed from arm32 - check*/
70 *(.fixup) 70 *(.fixup)
@@ -111,7 +111,7 @@ SECTIONS
111 /* 111 /*
112 * and the usual data section 112 * and the usual data section
113 */ 113 */
114 *(.data) 114 DATA_DATA
115 CONSTRUCTORS 115 CONSTRUCTORS
116 116
117 *(.init.data) 117 *(.init.data)
diff --git a/arch/arm26/kernel/vmlinux-arm26.lds.in b/arch/arm26/kernel/vmlinux-arm26.lds.in
index 1d2949e83be8..6c44f6a17bf7 100644
--- a/arch/arm26/kernel/vmlinux-arm26.lds.in
+++ b/arch/arm26/kernel/vmlinux-arm26.lds.in
@@ -65,7 +65,7 @@ SECTIONS
65 65
66 .text : { /* Real text segment */ 66 .text : { /* Real text segment */
67 _text = .; /* Text and read-only data */ 67 _text = .; /* Text and read-only data */
68 *(.text) 68 TEXT_TEXT
69 SCHED_TEXT 69 SCHED_TEXT
70 LOCK_TEXT 70 LOCK_TEXT
71 *(.fixup) 71 *(.fixup)
@@ -106,7 +106,7 @@ SECTIONS
106 /* 106 /*
107 * and the usual data section 107 * and the usual data section
108 */ 108 */
109 *(.data) 109 DATA_DATA
110 CONSTRUCTORS 110 CONSTRUCTORS
111 111
112 _edata = .; 112 _edata = .;
diff --git a/arch/avr32/kernel/vmlinux.lds.c b/arch/avr32/kernel/vmlinux.lds.c
index e7f72c995a32..db0438f35c00 100644
--- a/arch/avr32/kernel/vmlinux.lds.c
+++ b/arch/avr32/kernel/vmlinux.lds.c
@@ -76,7 +76,7 @@ SECTIONS
76 . = 0x100; 76 . = 0x100;
77 *(.scall.text) 77 *(.scall.text)
78 *(.irq.text) 78 *(.irq.text)
79 *(.text) 79 TEXT_TEXT
80 SCHED_TEXT 80 SCHED_TEXT
81 LOCK_TEXT 81 LOCK_TEXT
82 KPROBES_TEXT 82 KPROBES_TEXT
@@ -112,7 +112,7 @@ SECTIONS
112 112
113 /* And the rest... */ 113 /* And the rest... */
114 *(.data.rel*) 114 *(.data.rel*)
115 *(.data) 115 DATA_DATA
116 CONSTRUCTORS 116 CONSTRUCTORS
117 117
118 _edata = .; 118 _edata = .;
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 6ae9ebbd8e58..86fe67995802 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -54,7 +54,7 @@ SECTIONS
54 { 54 {
55 _text = .; 55 _text = .;
56 __stext = .; 56 __stext = .;
57 *(.text) 57 TEXT_TEXT
58 SCHED_TEXT 58 SCHED_TEXT
59 *(.text.lock) 59 *(.text.lock)
60 . = ALIGN(16); 60 . = ALIGN(16);
@@ -200,7 +200,7 @@ SECTIONS
200 __sdata = .; 200 __sdata = .;
201 . = ALIGN(0x2000); 201 . = ALIGN(0x2000);
202 *(.data.init_task) 202 *(.data.init_task)
203 *(.data) 203 DATA_DATA
204 204
205 . = ALIGN(32); 205 . = ALIGN(32);
206 *(.data.cacheline_aligned) 206 *(.data.cacheline_aligned)
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index 28eae9735ad6..481dc1374640 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -101,13 +101,14 @@ SECTIONS
101 _stext = .; 101 _stext = .;
102 .text : { 102 .text : {
103 *( 103 *(
104 .text.start .text .text.* 104 .text.start .text.*
105#ifdef CONFIG_DEBUG_INFO 105#ifdef CONFIG_DEBUG_INFO
106 .init.text 106 .init.text
107 .exit.text 107 .exit.text
108 .exitcall.exit 108 .exitcall.exit
109#endif 109#endif
110 ) 110 )
111 TEXT_TEXT
111 SCHED_TEXT 112 SCHED_TEXT
112 LOCK_TEXT 113 LOCK_TEXT
113 *(.fixup) 114 *(.fixup)
@@ -135,7 +136,8 @@ SECTIONS
135 136
136 _sdata = .; 137 _sdata = .;
137 .data : { /* Data */ 138 .data : { /* Data */
138 *(.data .data.*) 139 DATA_DATA
140 *(.data.*)
139 *(.exit.data) 141 *(.exit.data)
140 CONSTRUCTORS 142 CONSTRUCTORS
141 } 143 }
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 65f1cdc5ee04..a2e72d495551 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -75,7 +75,7 @@ SECTIONS
75 *(.int_redirect) 75 *(.int_redirect)
76#endif 76#endif
77 __stext = . ; 77 __stext = . ;
78 *(.text) 78 TEXT_TEXT
79 SCHED_TEXT 79 SCHED_TEXT
80 LOCK_TEXT 80 LOCK_TEXT
81 __etext = . ; 81 __etext = . ;
@@ -103,7 +103,7 @@ SECTIONS
103 . = ALIGN(0x2000) ; 103 . = ALIGN(0x2000) ;
104 *(.data.init_task) 104 *(.data.init_task)
105 . = ALIGN(0x4) ; 105 . = ALIGN(0x4) ;
106 *(.data) 106 DATA_DATA
107 . = ALIGN(0x4) ; 107 . = ALIGN(0x4) ;
108 *(.data.*) 108 *(.data.*)
109 109
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 80bec6640230..aa87b06c7c82 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -44,7 +44,7 @@ SECTIONS
44 44
45 /* read-only */ 45 /* read-only */
46 .text : AT(ADDR(.text) - LOAD_OFFSET) { 46 .text : AT(ADDR(.text) - LOAD_OFFSET) {
47 *(.text) 47 TEXT_TEXT
48 SCHED_TEXT 48 SCHED_TEXT
49 LOCK_TEXT 49 LOCK_TEXT
50 KPROBES_TEXT 50 KPROBES_TEXT
@@ -74,7 +74,7 @@ SECTIONS
74 /* writeable */ 74 /* writeable */
75 . = ALIGN(4096); 75 . = ALIGN(4096);
76 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ 76 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
77 *(.data) 77 DATA_DATA
78 CONSTRUCTORS 78 CONSTRUCTORS
79 } :data 79 } :data
80 80
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 692382642118..5a65965c8b53 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -44,7 +44,7 @@ SECTIONS
44 .text : AT(ADDR(.text) - LOAD_OFFSET) 44 .text : AT(ADDR(.text) - LOAD_OFFSET)
45 { 45 {
46 IVT_TEXT 46 IVT_TEXT
47 *(.text) 47 TEXT_TEXT
48 SCHED_TEXT 48 SCHED_TEXT
49 LOCK_TEXT 49 LOCK_TEXT
50 KPROBES_TEXT 50 KPROBES_TEXT
@@ -214,7 +214,12 @@ SECTIONS
214 214
215 data : { } :data 215 data : { } :data
216 .data : AT(ADDR(.data) - LOAD_OFFSET) 216 .data : AT(ADDR(.data) - LOAD_OFFSET)
217 { *(.data) *(.data1) *(.gnu.linkonce.d*) CONSTRUCTORS } 217 {
218 DATA_DATA
219 *(.data1)
220 *(.gnu.linkonce.d*)
221 CONSTRUCTORS
222 }
218 223
219 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */ 224 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
220 .got : AT(ADDR(.got) - LOAD_OFFSET) 225 .got : AT(ADDR(.got) - LOAD_OFFSET)
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 6c73bca3f478..4e2d5b9f0a9a 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -27,7 +27,7 @@ SECTIONS
27 _text = .; /* Text and read-only data */ 27 _text = .; /* Text and read-only data */
28 .boot : { *(.boot) } = 0 28 .boot : { *(.boot) } = 0
29 .text : { 29 .text : {
30 *(.text) 30 TEXT_TEXT
31 SCHED_TEXT 31 SCHED_TEXT
32 LOCK_TEXT 32 LOCK_TEXT
33 *(.fixup) 33 *(.fixup)
@@ -50,7 +50,7 @@ SECTIONS
50 .data : { /* Data */ 50 .data : { /* Data */
51 *(.spu) 51 *(.spu)
52 *(.spi) 52 *(.spi)
53 *(.data) 53 DATA_DATA
54 CONSTRUCTORS 54 CONSTRUCTORS
55 } 55 }
56 56
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 437b4f8d86c5..78f139226a1b 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -11,7 +11,7 @@ SECTIONS
11 . = 0x1000; 11 . = 0x1000;
12 _text = .; /* Text and read-only data */ 12 _text = .; /* Text and read-only data */
13 .text : { 13 .text : {
14 *(.text) 14 TEXT_TEXT
15 SCHED_TEXT 15 SCHED_TEXT
16 LOCK_TEXT 16 LOCK_TEXT
17 *(.fixup) 17 *(.fixup)
@@ -28,7 +28,7 @@ SECTIONS
28 _etext = .; /* End of text section */ 28 _etext = .; /* End of text section */
29 29
30 .data : { /* Data */ 30 .data : { /* Data */
31 *(.data) 31 DATA_DATA
32 CONSTRUCTORS 32 CONSTRUCTORS
33 } 33 }
34 34
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 2868e206fc76..c8999b2db23b 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -12,7 +12,7 @@ SECTIONS
12 _text = .; /* Text and read-only data */ 12 _text = .; /* Text and read-only data */
13 .text : { 13 .text : {
14 *(.head) 14 *(.head)
15 *(.text) 15 TEXT_TEXT
16 SCHED_TEXT 16 SCHED_TEXT
17 LOCK_TEXT 17 LOCK_TEXT
18 *(.fixup) 18 *(.fixup)
@@ -23,7 +23,7 @@ SECTIONS
23 _etext = .; /* End of text section */ 23 _etext = .; /* End of text section */
24 24
25 .data : { /* Data */ 25 .data : { /* Data */
26 *(.data) 26 DATA_DATA
27 CONSTRUCTORS 27 CONSTRUCTORS
28 . = ALIGN(16); /* Exception table */ 28 . = ALIGN(16); /* Exception table */
29 __start___ex_table = .; 29 __start___ex_table = .;
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index c86a1bf589d4..07a0055602f4 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -62,7 +62,7 @@ SECTIONS {
62 .text : { 62 .text : {
63 _text = .; 63 _text = .;
64 _stext = . ; 64 _stext = . ;
65 *(.text) 65 TEXT_TEXT
66 SCHED_TEXT 66 SCHED_TEXT
67 *(.text.lock) 67 *(.text.lock)
68 68
@@ -133,7 +133,7 @@ SECTIONS {
133 .data DATA_ADDR : { 133 .data DATA_ADDR : {
134 . = ALIGN(4); 134 . = ALIGN(4);
135 _sdata = . ; 135 _sdata = . ;
136 *(.data) 136 DATA_DATA
137 . = ALIGN(8192) ; 137 . = ALIGN(8192) ;
138 *(.data.init_task) 138 *(.data.init_task)
139 _edata = . ; 139 _edata = . ;
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 043f637e3d10..9b9992cd562a 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -27,7 +27,7 @@ SECTIONS
27 /* read-only */ 27 /* read-only */
28 _text = .; /* Text and read-only data */ 28 _text = .; /* Text and read-only data */
29 .text : { 29 .text : {
30 *(.text) 30 TEXT_TEXT
31 SCHED_TEXT 31 SCHED_TEXT
32 LOCK_TEXT 32 LOCK_TEXT
33 *(.fixup) 33 *(.fixup)
@@ -62,7 +62,7 @@ SECTIONS
62 . = ALIGN(_PAGE_SIZE); 62 . = ALIGN(_PAGE_SIZE);
63 *(.data.init_task) 63 *(.data.init_task)
64 64
65 *(.data) 65 DATA_DATA
66 66
67 CONSTRUCTORS 67 CONSTRUCTORS
68 } 68 }
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index c74585990598..4d96ba4b9849 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -51,7 +51,7 @@ SECTIONS
51 51
52 _text = .; /* Text and read-only data */ 52 _text = .; /* Text and read-only data */
53 .text ALIGN(16) : { 53 .text ALIGN(16) : {
54 *(.text) 54 TEXT_TEXT
55 SCHED_TEXT 55 SCHED_TEXT
56 LOCK_TEXT 56 LOCK_TEXT
57 *(.text.do_softirq) 57 *(.text.do_softirq)
@@ -91,7 +91,7 @@ SECTIONS
91 91
92 . = ALIGN(L1_CACHE_BYTES); 92 . = ALIGN(L1_CACHE_BYTES);
93 .data : { /* Data */ 93 .data : { /* Data */
94 *(.data) 94 DATA_DATA
95 CONSTRUCTORS 95 CONSTRUCTORS
96 } 96 }
97 97
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 132067313147..f7d7bf19e4fb 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -34,7 +34,8 @@ SECTIONS
34 /* Text and gots */ 34 /* Text and gots */
35 .text : { 35 .text : {
36 _text = .; 36 _text = .;
37 *(.text .text.*) 37 *(.text.*)
38 TEXT_TEXT
38 SCHED_TEXT 39 SCHED_TEXT
39 LOCK_TEXT 40 LOCK_TEXT
40 KPROBES_TEXT 41 KPROBES_TEXT
@@ -167,7 +168,7 @@ SECTIONS
167#ifdef CONFIG_PPC32 168#ifdef CONFIG_PPC32
168 .data : 169 .data :
169 { 170 {
170 *(.data) 171 DATA_DATA
171 *(.sdata) 172 *(.sdata)
172 *(.got.plt) *(.got) 173 *(.got.plt) *(.got)
173 } 174 }
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index 44cd128fb719..19db8746ff14 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -32,7 +32,7 @@ SECTIONS
32 .text : 32 .text :
33 { 33 {
34 _text = .; 34 _text = .;
35 *(.text) 35 TEXT_TEXT
36 SCHED_TEXT 36 SCHED_TEXT
37 LOCK_TEXT 37 LOCK_TEXT
38 *(.fixup) 38 *(.fixup)
@@ -67,7 +67,7 @@ SECTIONS
67 . = ALIGN(4096); 67 . = ALIGN(4096);
68 .data : 68 .data :
69 { 69 {
70 *(.data) 70 DATA_DATA
71 *(.data1) 71 *(.data1)
72 *(.sdata) 72 *(.sdata)
73 *(.sdata2) 73 *(.sdata2)
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index e9d3432aba60..7158a804a5e4 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -21,7 +21,7 @@ SECTIONS
21 . = 0x00000000; 21 . = 0x00000000;
22 _text = .; /* Text and read-only data */ 22 _text = .; /* Text and read-only data */
23 .text : { 23 .text : {
24 *(.text) 24 TEXT_TEXT
25 SCHED_TEXT 25 SCHED_TEXT
26 LOCK_TEXT 26 LOCK_TEXT
27 KPROBES_TEXT 27 KPROBES_TEXT
@@ -48,7 +48,7 @@ SECTIONS
48 BUG_TABLE 48 BUG_TABLE
49 49
50 .data : { /* Data */ 50 .data : { /* Data */
51 *(.data) 51 DATA_DATA
52 CONSTRUCTORS 52 CONSTRUCTORS
53 } 53 }
54 54
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index d83143cc5ca9..4c5b57e9c3c1 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -22,7 +22,7 @@ SECTIONS
22 *(.empty_zero_page) 22 *(.empty_zero_page)
23 } = 0 23 } = 0
24 .text : { 24 .text : {
25 *(.text) 25 TEXT_TEXT
26 SCHED_TEXT 26 SCHED_TEXT
27 LOCK_TEXT 27 LOCK_TEXT
28 *(.fixup) 28 *(.fixup)
@@ -41,7 +41,7 @@ SECTIONS
41 BUG_TABLE 41 BUG_TABLE
42 42
43 .data : { /* Data */ 43 .data : { /* Data */
44 *(.data) 44 DATA_DATA
45 45
46 /* Align the initial ramdisk image (INITRD) on page boundaries. */ 46 /* Align the initial ramdisk image (INITRD) on page boundaries. */
47 . = ALIGN(PAGE_SIZE); 47 . = ALIGN(PAGE_SIZE);
diff --git a/arch/sh64/kernel/vmlinux.lds.S b/arch/sh64/kernel/vmlinux.lds.S
index 4f9616f39830..02aea86c5907 100644
--- a/arch/sh64/kernel/vmlinux.lds.S
+++ b/arch/sh64/kernel/vmlinux.lds.S
@@ -54,7 +54,7 @@ SECTIONS
54 } = 0 54 } = 0
55 55
56 .text : C_PHYS(.text) { 56 .text : C_PHYS(.text) {
57 *(.text) 57 TEXT_TEXT
58 *(.text64) 58 *(.text64)
59 *(.text..SHmedia32) 59 *(.text..SHmedia32)
60 SCHED_TEXT 60 SCHED_TEXT
@@ -78,7 +78,7 @@ SECTIONS
78 _etext = .; /* End of text section */ 78 _etext = .; /* End of text section */
79 79
80 .data : C_PHYS(.data) { /* Data */ 80 .data : C_PHYS(.data) { /* Data */
81 *(.data) 81 DATA_DATA
82 CONSTRUCTORS 82 CONSTRUCTORS
83 } 83 }
84 84
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index f0bb6e60e620..f75a1b822789 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -12,7 +12,7 @@ SECTIONS
12 .text 0xf0004000 : 12 .text 0xf0004000 :
13 { 13 {
14 _text = .; 14 _text = .;
15 *(.text) 15 TEXT_TEXT
16 SCHED_TEXT 16 SCHED_TEXT
17 LOCK_TEXT 17 LOCK_TEXT
18 *(.gnu.warning) 18 *(.gnu.warning)
@@ -22,7 +22,7 @@ SECTIONS
22 RODATA 22 RODATA
23 .data : 23 .data :
24 { 24 {
25 *(.data) 25 DATA_DATA
26 CONSTRUCTORS 26 CONSTRUCTORS
27 } 27 }
28 .data1 : { *(.data1) } 28 .data1 : { *(.data1) }
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S
index 13fa2a2e4513..fb648de18a8d 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -14,7 +14,7 @@ SECTIONS
14 .text 0x0000000000404000 : 14 .text 0x0000000000404000 :
15 { 15 {
16 _text = .; 16 _text = .;
17 *(.text) 17 TEXT_TEXT
18 SCHED_TEXT 18 SCHED_TEXT
19 LOCK_TEXT 19 LOCK_TEXT
20 KPROBES_TEXT 20 KPROBES_TEXT
@@ -27,7 +27,7 @@ SECTIONS
27 27
28 .data : 28 .data :
29 { 29 {
30 *(.data) 30 DATA_DATA
31 CONSTRUCTORS 31 CONSTRUCTORS
32 } 32 }
33 .data1 : { *(.data1) } 33 .data1 : { *(.data1) }
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 87a4e4427d8d..24547741b205 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -62,7 +62,7 @@ SECTIONS
62 } =0x90909090 62 } =0x90909090
63 .plt : { *(.plt) } 63 .plt : { *(.plt) }
64 .text : { 64 .text : {
65 *(.text) 65 TEXT_TEXT
66 SCHED_TEXT 66 SCHED_TEXT
67 LOCK_TEXT 67 LOCK_TEXT
68 *(.fixup) 68 *(.fixup)
@@ -99,7 +99,8 @@ SECTIONS
99 *(.data.init_task) 99 *(.data.init_task)
100 . = ALIGN(KERNEL_STACK_SIZE); 100 . = ALIGN(KERNEL_STACK_SIZE);
101 *(.data.init_irqstack) 101 *(.data.init_irqstack)
102 *(.data .data.* .gnu.linkonce.d.*) 102 DATA_DATA
103 *(.data.* .gnu.linkonce.d.*)
103 SORT(CONSTRUCTORS) 104 SORT(CONSTRUCTORS)
104 } 105 }
105 .data1 : { *(.data1) } 106 .data1 : { *(.data1) }
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index bc59f97e34d0..307b9373676b 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -37,7 +37,7 @@ SECTIONS
37 37
38 .text : 38 .text :
39 { 39 {
40 *(.text) 40 TEXT_TEXT
41 SCHED_TEXT 41 SCHED_TEXT
42 LOCK_TEXT 42 LOCK_TEXT
43 *(.fixup) 43 *(.fixup)
@@ -61,7 +61,7 @@ SECTIONS
61 *(.data.init_task) 61 *(.data.init_task)
62 . = ALIGN(KERNEL_STACK_SIZE); 62 . = ALIGN(KERNEL_STACK_SIZE);
63 *(.data.init_irqstack) 63 *(.data.init_irqstack)
64 *(.data) 64 DATA_DATA
65 *(.gnu.linkonce.d*) 65 *(.gnu.linkonce.d*)
66 CONSTRUCTORS 66 CONSTRUCTORS
67 } 67 }
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index 356308221251..6172599b4ce2 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -92,7 +92,7 @@
92#define TEXT_CONTENTS \ 92#define TEXT_CONTENTS \
93 _text = .; \ 93 _text = .; \
94 __stext = . ; \ 94 __stext = . ; \
95 *(.text) \ 95 TEXT_TEXT \
96 SCHED_TEXT \ 96 SCHED_TEXT \
97 *(.exit.text) /* 2.5 convention */ \ 97 *(.exit.text) /* 2.5 convention */ \
98 *(.text.exit) /* 2.4 convention */ \ 98 *(.text.exit) /* 2.4 convention */ \
@@ -113,7 +113,7 @@
113/* Kernel data segment. */ 113/* Kernel data segment. */
114#define DATA_CONTENTS \ 114#define DATA_CONTENTS \
115 __sdata = . ; \ 115 __sdata = . ; \
116 *(.data) \ 116 DATA_DATA \
117 *(.exit.data) /* 2.5 convention */ \ 117 *(.exit.data) /* 2.5 convention */ \
118 *(.data.exit) /* 2.4 convention */ \ 118 *(.data.exit) /* 2.4 convention */ \
119 . = ALIGN (16) ; \ 119 . = ALIGN (16) ; \
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index 88cfa50b424d..dbccfda8364f 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -31,7 +31,7 @@ SECTIONS
31 *(.bootstrap.text) 31 *(.bootstrap.text)
32 _stext = .; 32 _stext = .;
33 /* Then the rest */ 33 /* Then the rest */
34 *(.text) 34 TEXT_TEXT
35 SCHED_TEXT 35 SCHED_TEXT
36 LOCK_TEXT 36 LOCK_TEXT
37 KPROBES_TEXT 37 KPROBES_TEXT
@@ -55,7 +55,7 @@ SECTIONS
55 . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ 55 . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */
56 /* Data */ 56 /* Data */
57 .data : AT(ADDR(.data) - LOAD_OFFSET) { 57 .data : AT(ADDR(.data) - LOAD_OFFSET) {
58 *(.data) 58 DATA_DATA
59 CONSTRUCTORS 59 CONSTRUCTORS
60 } :data 60 } :data
61 61
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 4fbd66a52a88..4b7b4ff79973 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -84,7 +84,8 @@ SECTIONS
84 { 84 {
85 /* The .head.text section must be the first section! */ 85 /* The .head.text section must be the first section! */
86 *(.head.text) 86 *(.head.text)
87 *(.literal .text) 87 *(.literal)
88 TEXT_TEXT
88 *(.srom.text) 89 *(.srom.text)
89 VMLINUX_SYMBOL(__sched_text_start) = .; 90 VMLINUX_SYMBOL(__sched_text_start) = .;
90 *(.sched.literal .sched.text) 91 *(.sched.literal .sched.text)
@@ -144,7 +145,8 @@ SECTIONS
144 _fdata = .; 145 _fdata = .;
145 .data : 146 .data :
146 { 147 {
147 *(.data) CONSTRUCTORS 148 DATA_DATA
149 CONSTRUCTORS
148 . = ALIGN(XCHAL_ICACHE_LINESIZE); 150 . = ALIGN(XCHAL_ICACHE_LINESIZE);
149 *(.data.cacheline_aligned) 151 *(.data.cacheline_aligned)
150 } 152 }
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f3806a74c478..8307b1bb337a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -9,6 +9,11 @@
9/* Align . to a 8 byte boundary equals to maximum function alignment. */ 9/* Align . to a 8 byte boundary equals to maximum function alignment. */
10#define ALIGN_FUNCTION() . = ALIGN(8) 10#define ALIGN_FUNCTION() . = ALIGN(8)
11 11
12/* .data section */
13#define DATA_DATA \
14 *(.data) \
15 *(.data.init.refok)
16
12#define RODATA \ 17#define RODATA \
13 . = ALIGN(4096); \ 18 . = ALIGN(4096); \
14 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ 19 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
@@ -139,6 +144,13 @@
139 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 144 VMLINUX_SYMBOL(__security_initcall_end) = .; \
140 } 145 }
141 146
147/* .text section. Map to function alignment to avoid address changes
148 * during second ld run in second ld pass when generating System.map */
149#define TEXT_TEXT \
150 ALIGN_FUNCTION(); \
151 *(.text) \
152 *(.text.init.refok)
153
142/* sched.text is aling to function alignment to secure we have same 154/* sched.text is aling to function alignment to secure we have same
143 * address even at second ld pass when generating System.map */ 155 * address even at second ld pass when generating System.map */
144#define SCHED_TEXT \ 156#define SCHED_TEXT \
diff --git a/include/linux/init.h b/include/linux/init.h
index e007ae4dc41e..56ec4c62eee0 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -45,6 +45,19 @@
45#define __exitdata __attribute__ ((__section__(".exit.data"))) 45#define __exitdata __attribute__ ((__section__(".exit.data")))
46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) 46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
47 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
48#ifdef MODULE 61#ifdef MODULE
49#define __exit __attribute__ ((__section__(".exit.text"))) 62#define __exit __attribute__ ((__section__(".exit.text")))
50#else 63#else
diff --git a/init/main.c b/init/main.c
index 1940fa75e82e..eb8bdbae4fc7 100644
--- a/init/main.c
+++ b/init/main.c
@@ -423,7 +423,7 @@ static void __init setup_command_line(char *command_line)
423 * gcc-3.4 accidentally inlines this function, so use noinline. 423 * gcc-3.4 accidentally inlines this function, so use noinline.
424 */ 424 */
425 425
426static void noinline rest_init(void) 426static void noinline __init_refok rest_init(void)
427 __releases(kernel_lock) 427 __releases(kernel_lock)
428{ 428{
429 int pid; 429 int pid;
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ae96dd844432..8b000d6803c2 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2165,7 +2165,7 @@ void __init setup_per_cpu_pageset(void)
2165 2165
2166#endif 2166#endif
2167 2167
2168static __meminit noinline 2168static noinline __init_refok
2169int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages) 2169int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
2170{ 2170{
2171 int i; 2171 int i;
@@ -2678,7 +2678,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
2678 } 2678 }
2679} 2679}
2680 2680
2681static void __meminit alloc_node_mem_map(struct pglist_data *pgdat) 2681static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
2682{ 2682{
2683 /* Skip empty nodes */ 2683 /* Skip empty nodes */
2684 if (!pgdat->node_spanned_pages) 2684 if (!pgdat->node_spanned_pages)
diff --git a/mm/slab.c b/mm/slab.c
index 528243e15cc8..2e71a328aa09 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2037,7 +2037,7 @@ static size_t calculate_slab_order(struct kmem_cache *cachep,
2037 return left_over; 2037 return left_over;
2038} 2038}
2039 2039
2040static int setup_cpu_cache(struct kmem_cache *cachep) 2040static int __init_refok setup_cpu_cache(struct kmem_cache *cachep)
2041{ 2041{
2042 if (g_cpucache_up == FULL) 2042 if (g_cpucache_up == FULL)
2043 return enable_cpucache(cachep); 2043 return enable_cpucache(cachep);
diff --git a/mm/sparse.c b/mm/sparse.c
index 6f3fff907bc2..1302f8348d51 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -44,7 +44,7 @@ EXPORT_SYMBOL(page_to_nid);
44#endif 44#endif
45 45
46#ifdef CONFIG_SPARSEMEM_EXTREME 46#ifdef CONFIG_SPARSEMEM_EXTREME
47static struct mem_section noinline *sparse_index_alloc(int nid) 47static struct mem_section noinline __init_refok *sparse_index_alloc(int nid)
48{ 48{
49 struct mem_section *section = NULL; 49 struct mem_section *section = NULL;
50 unsigned long array_size = SECTIONS_PER_ROOT * 50 unsigned long array_size = SECTIONS_PER_ROOT *
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 120d624e672c..cdca7388e0f1 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,21 +4,15 @@
4# What library to link 4# What library to link
5ldflags() 5ldflags()
6{ 6{
7 $cc -print-file-name=libncursesw.so | grep -q / 7 for ext in so a dylib ; do
8 if [ $? -eq 0 ]; then 8 for lib in ncursesw ncurses curses ; do
9 echo '-lncursesw' 9 $cc -print-file-name=lib${lib}.${ext} | grep -q /
10 exit 10 if [ $? -eq 0 ]; then
11 fi 11 echo "-l${lib}"
12 $cc -print-file-name=libncurses.so | grep -q / 12 exit
13 if [ $? -eq 0 ]; then 13 fi
14 echo '-lncurses' 14 done
15 exit 15 done
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 16 exit 1
23} 17}
24 18
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index ed1244dd58d0..f646381dc015 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -353,11 +353,16 @@ static int do_pcmcia_entry(const char *filename,
353 353
354static int do_of_entry (const char *filename, struct of_device_id *of, char *alias) 354static int do_of_entry (const char *filename, struct of_device_id *of, char *alias)
355{ 355{
356 int len;
356 char *tmp; 357 char *tmp;
357 sprintf (alias, "of:N%sT%sC%s", 358 len = sprintf (alias, "of:N%sT%s",
358 of->name[0] ? of->name : "*", 359 of->name[0] ? of->name : "*",
359 of->type[0] ? of->type : "*", 360 of->type[0] ? of->type : "*");
360 of->compatible[0] ? of->compatible : "*"); 361
362 if (of->compatible[0])
363 sprintf (&alias[len], "%sC%s",
364 of->type[0] ? "*" : "",
365 of->compatible);
361 366
362 /* Replace all whitespace with underscores */ 367 /* Replace all whitespace with underscores */
363 for (tmp = alias; tmp && *tmp; tmp++) 368 for (tmp = alias; tmp && *tmp; tmp++)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 113dc77b9f60..8424d1f53bbe 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -384,6 +384,7 @@ static int parse_elf(struct elf_info *info, const char *filename)
384 sechdrs[i].sh_size = TO_NATIVE(sechdrs[i].sh_size); 384 sechdrs[i].sh_size = TO_NATIVE(sechdrs[i].sh_size);
385 sechdrs[i].sh_link = TO_NATIVE(sechdrs[i].sh_link); 385 sechdrs[i].sh_link = TO_NATIVE(sechdrs[i].sh_link);
386 sechdrs[i].sh_name = TO_NATIVE(sechdrs[i].sh_name); 386 sechdrs[i].sh_name = TO_NATIVE(sechdrs[i].sh_name);
387 sechdrs[i].sh_info = TO_NATIVE(sechdrs[i].sh_info);
387 } 388 }
388 /* Find symbol table. */ 389 /* Find symbol table. */
389 for (i = 1; i < hdr->e_shnum; i++) { 390 for (i = 1; i < hdr->e_shnum; i++) {
@@ -582,6 +583,12 @@ static int strrcmp(const char *s, const char *sub)
582 583
583/** 584/**
584 * Whitelist to allow certain references to pass with no warning. 585 * Whitelist to allow certain references to pass with no warning.
586 *
587 * Pattern 0:
588 * Do not warn if funtion/data are marked with __init_refok/__initdata_refok.
589 * The pattern is identified by:
590 * fromsec = .text.init.refok | .data.init.refok
591 *
585 * Pattern 1: 592 * Pattern 1:
586 * If a module parameter is declared __initdata and permissions=0 593 * If a module parameter is declared __initdata and permissions=0
587 * then this is legal despite the warning generated. 594 * then this is legal despite the warning generated.
@@ -619,14 +626,6 @@ static int strrcmp(const char *s, const char *sub)
619 * This pattern is identified by 626 * This pattern is identified by
620 * refsymname = __init_begin, _sinittext, _einittext 627 * refsymname = __init_begin, _sinittext, _einittext
621 * 628 *
622 * Pattern 6:
623 * During the early init phase we have references from .init.text to
624 * .text we have an intended section mismatch - do not warn about it.
625 * See kernel_init() in init/main.c
626 * tosec = .init.text
627 * fromsec = .text
628 * atsym = kernel_init
629 *
630 * Pattern 7: 629 * Pattern 7:
631 * Logos used in drivers/video/logo reside in __initdata but the 630 * Logos used in drivers/video/logo reside in __initdata but the
632 * funtion that references them are EXPORT_SYMBOL() so cannot be 631 * funtion that references them are EXPORT_SYMBOL() so cannot be
@@ -642,16 +641,11 @@ static int strrcmp(const char *s, const char *sub)
642 * tosec = .init.text 641 * tosec = .init.text
643 * fromsec = .paravirtprobe 642 * fromsec = .paravirtprobe
644 * 643 *
645 * Pattern 9:
646 * Some of functions are common code between boot time and hotplug
647 * time. The bootmem allocater is called only boot time in its
648 * functions. So it's ok to reference.
649 * tosec = .init.text
650 *
651 * Pattern 10: 644 * Pattern 10:
652 * ia64 has machvec table for each platform. It is mixture of function 645 * ia64 has machvec table for each platform and
653 * pointer of .init.text and .text. 646 * powerpc has a machine desc table for each platform.
654 * fromsec = .machvec 647 * It is mixture of function pointers of .init.text and .text.
648 * fromsec = .machvec | .machine.desc
655 **/ 649 **/
656static int secref_whitelist(const char *modname, const char *tosec, 650static int secref_whitelist(const char *modname, const char *tosec,
657 const char *fromsec, const char *atsym, 651 const char *fromsec, const char *atsym,
@@ -678,11 +672,10 @@ static int secref_whitelist(const char *modname, const char *tosec,
678 NULL 672 NULL
679 }; 673 };
680 674
681 const char *pat4sym[] = { 675 /* Check for pattern 0 */
682 "sparse_index_alloc", 676 if ((strcmp(fromsec, ".text.init.refok") == 0) ||
683 "zone_wait_table_init", 677 (strcmp(fromsec, ".data.init.refok") == 0))
684 NULL 678 return 1;
685 };
686 679
687 /* Check for pattern 1 */ 680 /* Check for pattern 1 */
688 if (strcmp(tosec, ".init.data") != 0) 681 if (strcmp(tosec, ".init.data") != 0)
@@ -725,12 +718,6 @@ static int secref_whitelist(const char *modname, const char *tosec,
725 if (strcmp(refsymname, *s) == 0) 718 if (strcmp(refsymname, *s) == 0)
726 return 1; 719 return 1;
727 720
728 /* Check for pattern 6 */
729 if ((strcmp(tosec, ".init.text") == 0) &&
730 (strcmp(fromsec, ".text") == 0) &&
731 (strcmp(refsymname, "kernel_init") == 0))
732 return 1;
733
734 /* Check for pattern 7 */ 721 /* Check for pattern 7 */
735 if ((strcmp(tosec, ".init.data") == 0) && 722 if ((strcmp(tosec, ".init.data") == 0) &&
736 (strncmp(fromsec, ".text", strlen(".text")) == 0) && 723 (strncmp(fromsec, ".text", strlen(".text")) == 0) &&
@@ -742,15 +729,9 @@ static int secref_whitelist(const char *modname, const char *tosec,
742 (strcmp(fromsec, ".paravirtprobe") == 0)) 729 (strcmp(fromsec, ".paravirtprobe") == 0))
743 return 1; 730 return 1;
744 731
745 /* Check for pattern 9 */
746 if ((strcmp(tosec, ".init.text") == 0) &&
747 (strcmp(fromsec, ".text") == 0))
748 for (s = pat4sym; *s; s++)
749 if (strcmp(atsym, *s) == 0)
750 return 1;
751
752 /* Check for pattern 10 */ 732 /* Check for pattern 10 */
753 if (strcmp(fromsec, ".machvec") == 0) 733 if ((strcmp(fromsec, ".machvec") == 0) ||
734 (strcmp(fromsec, ".machine.desc") == 0))
754 return 1; 735 return 1;
755 736
756 return 0; 737 return 0;
@@ -773,6 +754,8 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf_Addr addr,
773 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) { 754 for (sym = elf->symtab_start; sym < elf->symtab_stop; sym++) {
774 if (sym->st_shndx != relsym->st_shndx) 755 if (sym->st_shndx != relsym->st_shndx)
775 continue; 756 continue;
757 if (ELF_ST_TYPE(sym->st_info) == STT_SECTION)
758 continue;
776 if (sym->st_value == addr) 759 if (sym->st_value == addr)
777 return sym; 760 return sym;
778 } 761 }
@@ -884,33 +867,99 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec,
884 elf->strtab + before->st_name, refsymname)) 867 elf->strtab + before->st_name, refsymname))
885 return; 868 return;
886 869
870 /* fromsec whitelist - without a valid 'before'
871 * powerpc has a GOT table in .got2 section */
872 if (strcmp(fromsec, ".got2") == 0)
873 return;
874
887 if (before && after) { 875 if (before && after) {
888 warn("%s - Section mismatch: reference to %s:%s from %s " 876 warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s "
889 "between '%s' (at offset 0x%llx) and '%s'\n", 877 "(between '%s' and '%s')\n",
890 modname, secname, refsymname, fromsec, 878 modname, fromsec, (unsigned long long)r.r_offset,
879 secname, refsymname,
891 elf->strtab + before->st_name, 880 elf->strtab + before->st_name,
892 (long long)r.r_offset,
893 elf->strtab + after->st_name); 881 elf->strtab + after->st_name);
894 } else if (before) { 882 } else if (before) {
895 warn("%s - Section mismatch: reference to %s:%s from %s " 883 warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s "
896 "after '%s' (at offset 0x%llx)\n", 884 "(after '%s')\n",
897 modname, secname, refsymname, fromsec, 885 modname, fromsec, (unsigned long long)r.r_offset,
898 elf->strtab + before->st_name, 886 secname, refsymname,
899 (long long)r.r_offset); 887 elf->strtab + before->st_name);
900 } else if (after) { 888 } else if (after) {
901 warn("%s - Section mismatch: reference to %s:%s from %s " 889 warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s "
902 "before '%s' (at offset -0x%llx)\n", 890 "before '%s' (at offset -0x%llx)\n",
903 modname, secname, refsymname, fromsec, 891 modname, fromsec, (unsigned long long)r.r_offset,
904 elf->strtab + after->st_name, 892 secname, refsymname,
905 (long long)r.r_offset); 893 elf->strtab + after->st_name);
906 } else { 894 } else {
907 warn("%s - Section mismatch: reference to %s:%s from %s " 895 warn("%s(%s+0x%llx): Section mismatch: reference to %s:%s\n",
908 "(offset 0x%llx)\n", 896 modname, fromsec, (unsigned long long)r.r_offset,
909 modname, secname, fromsec, refsymname, 897 secname, refsymname);
910 (long long)r.r_offset);
911 } 898 }
912} 899}
913 900
901static void addend_386_rel(struct elf_info *elf, int section, Elf_Rela *r)
902{
903 Elf_Shdr *sechdrs = elf->sechdrs;
904 unsigned int r_typ;
905 unsigned int *location;
906
907 r_typ = ELF_R_TYPE(r->r_info);
908 location = (void *)elf->hdr +
909 sechdrs[sechdrs[section].sh_info].sh_offset + r->r_offset;
910 switch (r_typ) {
911 case R_386_32:
912 r->r_addend = TO_NATIVE(*location);
913 break;
914 case R_386_PC32:
915 r->r_addend = TO_NATIVE(*location) + 4;
916 break;
917 }
918}
919
920static void addend_arm_rel(struct elf_info *elf, int section, Elf_Rela *r)
921{
922 Elf_Shdr *sechdrs = elf->sechdrs;
923 unsigned int r_typ;
924 unsigned int *location;
925
926 r_typ = ELF_R_TYPE(r->r_info);
927 location = (void *)elf->hdr +
928 sechdrs[sechdrs[section].sh_info].sh_offset + r->r_offset;
929 switch (r_typ) {
930 case R_ARM_ABS32:
931 r->r_addend = TO_NATIVE(*location);
932 break;
933 case R_ARM_PC24:
934 r->r_addend = ((TO_NATIVE(*location) & 0x00ffffff) << 2) + 8;
935 break;
936 }
937}
938
939static int addend_mips_rel(struct elf_info *elf, int section, Elf_Rela *r)
940{
941 Elf_Shdr *sechdrs = elf->sechdrs;
942 unsigned int r_typ;
943 unsigned int *location;
944 unsigned int inst;
945
946 r_typ = ELF_R_TYPE(r->r_info);
947 if (r_typ == R_MIPS_HI16)
948 return 1; /* skip this */
949 location = (void *)elf->hdr +
950 sechdrs[sechdrs[section].sh_info].sh_offset + r->r_offset;
951 inst = TO_NATIVE(*location);
952 switch (r_typ) {
953 case R_MIPS_LO16:
954 r->r_addend = ((inst & 0xffff) ^ 0x8000) - 0x8000;
955 break;
956 case R_MIPS_26:
957 r->r_addend = (inst & 0x03ffffff) << 2;
958 break;
959 }
960 return 0;
961}
962
914/** 963/**
915 * A module includes a number of sections that are discarded 964 * A module includes a number of sections that are discarded
916 * either when loaded or when used as built-in. 965 * either when loaded or when used as built-in.
@@ -954,8 +1003,11 @@ static void check_sec_ref(struct module *mod, const char *modname,
954 r.r_offset = TO_NATIVE(rela->r_offset); 1003 r.r_offset = TO_NATIVE(rela->r_offset);
955#if KERNEL_ELFCLASS == ELFCLASS64 1004#if KERNEL_ELFCLASS == ELFCLASS64
956 if (hdr->e_machine == EM_MIPS) { 1005 if (hdr->e_machine == EM_MIPS) {
1006 unsigned int r_typ;
957 r_sym = ELF64_MIPS_R_SYM(rela->r_info); 1007 r_sym = ELF64_MIPS_R_SYM(rela->r_info);
958 r_sym = TO_NATIVE(r_sym); 1008 r_sym = TO_NATIVE(r_sym);
1009 r_typ = ELF64_MIPS_R_TYPE(rela->r_info);
1010 r.r_info = ELF64_R_INFO(r_sym, r_typ);
959 } else { 1011 } else {
960 r.r_info = TO_NATIVE(rela->r_info); 1012 r.r_info = TO_NATIVE(rela->r_info);
961 r_sym = ELF_R_SYM(r.r_info); 1013 r_sym = ELF_R_SYM(r.r_info);
@@ -988,8 +1040,11 @@ static void check_sec_ref(struct module *mod, const char *modname,
988 r.r_offset = TO_NATIVE(rel->r_offset); 1040 r.r_offset = TO_NATIVE(rel->r_offset);
989#if KERNEL_ELFCLASS == ELFCLASS64 1041#if KERNEL_ELFCLASS == ELFCLASS64
990 if (hdr->e_machine == EM_MIPS) { 1042 if (hdr->e_machine == EM_MIPS) {
1043 unsigned int r_typ;
991 r_sym = ELF64_MIPS_R_SYM(rel->r_info); 1044 r_sym = ELF64_MIPS_R_SYM(rel->r_info);
992 r_sym = TO_NATIVE(r_sym); 1045 r_sym = TO_NATIVE(r_sym);
1046 r_typ = ELF64_MIPS_R_TYPE(rel->r_info);
1047 r.r_info = ELF64_R_INFO(r_sym, r_typ);
993 } else { 1048 } else {
994 r.r_info = TO_NATIVE(rel->r_info); 1049 r.r_info = TO_NATIVE(rel->r_info);
995 r_sym = ELF_R_SYM(r.r_info); 1050 r_sym = ELF_R_SYM(r.r_info);
@@ -999,6 +1054,14 @@ static void check_sec_ref(struct module *mod, const char *modname,
999 r_sym = ELF_R_SYM(r.r_info); 1054 r_sym = ELF_R_SYM(r.r_info);
1000#endif 1055#endif
1001 r.r_addend = 0; 1056 r.r_addend = 0;
1057 if (hdr->e_machine == EM_386)
1058 addend_386_rel(elf, i, &r);
1059 else if (hdr->e_machine == EM_ARM)
1060 addend_arm_rel(elf, i, &r);
1061 else if (hdr->e_machine == EM_MIPS) {
1062 if (addend_mips_rel(elf, i, &r))
1063 continue;
1064 }
1002 sym = elf->symtab_start + r_sym; 1065 sym = elf->symtab_start + r_sym;
1003 /* Skip special sections */ 1066 /* Skip special sections */
1004 if (sym->st_shndx >= SHN_LORESERVE) 1067 if (sym->st_shndx >= SHN_LORESERVE)
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 0858caa9c03f..4156dd34c5de 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -60,6 +60,9 @@ typedef union
60#define ELF64_MIPS_R_SYM(i) \ 60#define ELF64_MIPS_R_SYM(i) \
61 ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) 61 ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym)
62 62
63#define ELF64_MIPS_R_TYPE(i) \
64 ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_type1)
65
63#if KERNEL_ELFDATA != HOST_ELFDATA 66#if KERNEL_ELFDATA != HOST_ELFDATA
64 67
65static inline void __endian(const void *src, void *dest, unsigned int size) 68static inline void __endian(const void *src, void *dest, unsigned int size)
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index 6873d5af80d5..d9cc6901d680 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -7,6 +7,7 @@
7#include <ctype.h> 7#include <ctype.h>
8#include <errno.h> 8#include <errno.h>
9#include <string.h> 9#include <string.h>
10#include <limits.h>
10#include "modpost.h" 11#include "modpost.h"
11 12
12/* 13/*