aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2009-04-29 03:47:23 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-29 04:20:32 -0400
commit1f6397bac55040cd520d9eaf299e155a7aa01d5f (patch)
tree991bccc160d0e5e1825da18b4ca899d1e5f7b14f /arch/x86/kernel
parent448bc3ab0d03e77fee8e4264de0d001fc87bc164 (diff)
x86, vmlinux.lds: unify data output sections
For 64 bit the following functional changes are introduced: - .data.page_aligned has moved - .data.cacheline_aligned has moved - .data.read_mostly has moved - ALIGN() moved out of output section for .data.cacheline_aligned - ALIGN() moved out of output section for .data.page_aligned Notice that 32 bit and 64 bit has different location of _edata. .data_nosave is 32 bit only as 64 bit is special due to PERCPU. [ Impact: 32-bit: cleanup, 64-bit: use 32-bit linker script ] Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Tim Abbott <tabbott@MIT.EDU> Cc: Linus Torvalds <torvalds@linux-foundation.org> LKML-Reference: <1240991249-27117-7-git-send-email-sam@ravnborg.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/vmlinux.lds.S55
-rw-r--r--arch/x86/kernel/vmlinux_32.lds.S37
-rw-r--r--arch/x86/kernel/vmlinux_64.lds.S28
3 files changed, 55 insertions, 65 deletions
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 67164f6f092f..067bdb012dad 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -104,6 +104,61 @@ SECTIONS
104 104
105 RODATA 105 RODATA
106 106
107 /* Data */
108 . = ALIGN(PAGE_SIZE);
109 .data : AT(ADDR(.data) - LOAD_OFFSET) {
110 DATA_DATA
111 CONSTRUCTORS
112
113#ifdef CONFIG_X86_64
114 /* End of data section */
115 _edata = .;
116#endif
117 } :data
118
119#ifdef CONFIG_X86_32
120 /* 32 bit has nosave before _edata */
121 . = ALIGN(PAGE_SIZE);
122 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
123 __nosave_begin = .;
124 *(.data.nosave)
125 . = ALIGN(PAGE_SIZE);
126 __nosave_end = .;
127 }
128#endif
129
130 . = ALIGN(PAGE_SIZE);
131 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
132 *(.data.page_aligned)
133 *(.data.idt)
134 }
135
136#ifdef CONFIG_X86_32
137 . = ALIGN(32);
138#else
139 . = ALIGN(PAGE_SIZE);
140 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
141#endif
142 .data.cacheline_aligned :
143 AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
144 *(.data.cacheline_aligned)
145 }
146
147 /* rarely changed data like cpu maps */
148#ifdef CONFIG_X86_32
149 . = ALIGN(32);
150#else
151 . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
152#endif
153 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
154 *(.data.read_mostly)
155
156#ifdef CONFIG_X86_32
157 /* End of data section */
158 _edata = .;
159#endif
160 }
161
107 162
108#ifdef CONFIG_X86_32 163#ifdef CONFIG_X86_32
109# include "vmlinux_32.lds.S" 164# include "vmlinux_32.lds.S"
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 920cc6989cc7..8ade84687b2d 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -1,40 +1,3 @@
1 /* writeable */
2 . = ALIGN(PAGE_SIZE);
3 /* Data */
4 .data : AT(ADDR(.data) - LOAD_OFFSET) {
5 DATA_DATA
6 CONSTRUCTORS
7 } :data
8
9 . = ALIGN(PAGE_SIZE);
10 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
11 __nosave_begin = .;
12 *(.data.nosave)
13 . = ALIGN(PAGE_SIZE);
14 __nosave_end = .;
15 }
16
17 . = ALIGN(PAGE_SIZE);
18 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
19 *(.data.page_aligned)
20 *(.data.idt)
21 }
22
23 . = ALIGN(32);
24 .data.cacheline_aligned :
25 AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
26 *(.data.cacheline_aligned)
27 }
28
29 /* rarely changed data like cpu maps */
30 . = ALIGN(32);
31 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
32 *(.data.read_mostly)
33
34 /* End of data section */
35 _edata = .;
36 }
37
38 /* init_task */ 1 /* init_task */
39 . = ALIGN(THREAD_SIZE); 2 . = ALIGN(THREAD_SIZE);
40 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { 3 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index 641f3f991a01..826270147b5a 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -1,26 +1,3 @@
1 /* Align data segment to page size boundary */
2 . = ALIGN(PAGE_SIZE);
3 /* Data */
4 .data : AT(ADDR(.data) - LOAD_OFFSET) {
5 DATA_DATA
6 CONSTRUCTORS
7 /* End of data section */
8 _edata = .;
9 } :data
10
11
12 .data.cacheline_aligned :
13 AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
14 . = ALIGN(PAGE_SIZE);
15 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
16 *(.data.cacheline_aligned)
17 }
18
19 . = ALIGN(CONFIG_X86_INTERNODE_CACHE_BYTES);
20 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
21 *(.data.read_mostly)
22 }
23
24#define VSYSCALL_ADDR (-10*1024*1024) 1#define VSYSCALL_ADDR (-10*1024*1024)
25#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + \ 2#define VSYSCALL_PHYS_ADDR ((LOADADDR(.data.read_mostly) + \
26 SIZEOF(.data.read_mostly) + 4095) & ~(4095)) 3 SIZEOF(.data.read_mostly) + 4095) & ~(4095))
@@ -95,11 +72,6 @@
95 *(.data.init_task) 72 *(.data.init_task)
96 } :data.init 73 } :data.init
97 74
98 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
99 . = ALIGN(PAGE_SIZE);
100 *(.data.page_aligned)
101 }
102
103 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { 75 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
104 /* might get freed after init */ 76 /* might get freed after init */
105 . = ALIGN(PAGE_SIZE); 77 . = ALIGN(PAGE_SIZE);