diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-02-17 10:17:17 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-19 10:18:33 -0500 |
commit | 3cdac41f2090ad9013dfefab7399b1debfb9275a (patch) | |
tree | f3a1037032d814b5ee3e8b9acfee86d25fbd3758 /arch | |
parent | bbb1e57a1c0b732cfeb727bed7c61e80a79c6479 (diff) |
x86: lds - Use PAGE_SIZE instead of numeric constant
It's much better to use PAGE_SIZE then magic 4096
(though it's almost synonym in most cases on x86 but
not for *all* cases ;)
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/vmlinux_32.lds.S | 26 | ||||
-rw-r--r-- | arch/x86/kernel/vmlinux_64.lds.S | 28 |
2 files changed, 27 insertions, 27 deletions
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S index f1148ac8abe3..2ffa9656fe7a 100644 --- a/arch/x86/kernel/vmlinux_32.lds.S +++ b/arch/x86/kernel/vmlinux_32.lds.S | |||
@@ -38,7 +38,7 @@ SECTIONS | |||
38 | 38 | ||
39 | /* read-only */ | 39 | /* read-only */ |
40 | .text : AT(ADDR(.text) - LOAD_OFFSET) { | 40 | .text : AT(ADDR(.text) - LOAD_OFFSET) { |
41 | . = ALIGN(4096); /* not really needed, already page aligned */ | 41 | . = ALIGN(PAGE_SIZE); /* not really needed, already page aligned */ |
42 | *(.text.page_aligned) | 42 | *(.text.page_aligned) |
43 | TEXT_TEXT | 43 | TEXT_TEXT |
44 | SCHED_TEXT | 44 | SCHED_TEXT |
@@ -70,21 +70,21 @@ SECTIONS | |||
70 | RODATA | 70 | RODATA |
71 | 71 | ||
72 | /* writeable */ | 72 | /* writeable */ |
73 | . = ALIGN(4096); | 73 | . = ALIGN(PAGE_SIZE); |
74 | .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ | 74 | .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ |
75 | DATA_DATA | 75 | DATA_DATA |
76 | CONSTRUCTORS | 76 | CONSTRUCTORS |
77 | } :data | 77 | } :data |
78 | 78 | ||
79 | . = ALIGN(4096); | 79 | . = ALIGN(PAGE_SIZE); |
80 | .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { | 80 | .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { |
81 | __nosave_begin = .; | 81 | __nosave_begin = .; |
82 | *(.data.nosave) | 82 | *(.data.nosave) |
83 | . = ALIGN(4096); | 83 | . = ALIGN(PAGE_SIZE); |
84 | __nosave_end = .; | 84 | __nosave_end = .; |
85 | } | 85 | } |
86 | 86 | ||
87 | . = ALIGN(4096); | 87 | . = ALIGN(PAGE_SIZE); |
88 | .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { | 88 | .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { |
89 | *(.data.page_aligned) | 89 | *(.data.page_aligned) |
90 | *(.data.idt) | 90 | *(.data.idt) |
@@ -108,7 +108,7 @@ SECTIONS | |||
108 | } | 108 | } |
109 | 109 | ||
110 | /* might get freed after init */ | 110 | /* might get freed after init */ |
111 | . = ALIGN(4096); | 111 | . = ALIGN(PAGE_SIZE); |
112 | .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { | 112 | .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { |
113 | __smp_locks = .; | 113 | __smp_locks = .; |
114 | *(.smp_locks) | 114 | *(.smp_locks) |
@@ -120,10 +120,10 @@ SECTIONS | |||
120 | * after boot. Always make sure that ALIGN() directive is present after | 120 | * after boot. Always make sure that ALIGN() directive is present after |
121 | * the section which contains __smp_alt_end. | 121 | * the section which contains __smp_alt_end. |
122 | */ | 122 | */ |
123 | . = ALIGN(4096); | 123 | . = ALIGN(PAGE_SIZE); |
124 | 124 | ||
125 | /* will be freed after init */ | 125 | /* will be freed after init */ |
126 | . = ALIGN(4096); /* Init code and data */ | 126 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
127 | .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { | 127 | .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { |
128 | __init_begin = .; | 128 | __init_begin = .; |
129 | _sinittext = .; | 129 | _sinittext = .; |
@@ -174,23 +174,23 @@ SECTIONS | |||
174 | EXIT_DATA | 174 | EXIT_DATA |
175 | } | 175 | } |
176 | #if defined(CONFIG_BLK_DEV_INITRD) | 176 | #if defined(CONFIG_BLK_DEV_INITRD) |
177 | . = ALIGN(4096); | 177 | . = ALIGN(PAGE_SIZE); |
178 | .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { | 178 | .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { |
179 | __initramfs_start = .; | 179 | __initramfs_start = .; |
180 | *(.init.ramfs) | 180 | *(.init.ramfs) |
181 | __initramfs_end = .; | 181 | __initramfs_end = .; |
182 | } | 182 | } |
183 | #endif | 183 | #endif |
184 | . = ALIGN(4096); | 184 | . = ALIGN(PAGE_SIZE); |
185 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { | 185 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { |
186 | __per_cpu_start = .; | 186 | __per_cpu_start = .; |
187 | *(.data.percpu) | 187 | *(.data.percpu) |
188 | *(.data.percpu.shared_aligned) | 188 | *(.data.percpu.shared_aligned) |
189 | __per_cpu_end = .; | 189 | __per_cpu_end = .; |
190 | } | 190 | } |
191 | . = ALIGN(4096); | 191 | . = ALIGN(PAGE_SIZE); |
192 | /* freed after init ends here */ | 192 | /* freed after init ends here */ |
193 | 193 | ||
194 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { | 194 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { |
195 | __init_end = .; | 195 | __init_end = .; |
196 | __bss_start = .; /* BSS */ | 196 | __bss_start = .; /* BSS */ |
@@ -200,7 +200,7 @@ SECTIONS | |||
200 | __bss_stop = .; | 200 | __bss_stop = .; |
201 | _end = . ; | 201 | _end = . ; |
202 | /* This is where the kernel creates the early boot page tables */ | 202 | /* This is where the kernel creates the early boot page tables */ |
203 | . = ALIGN(4096); | 203 | . = ALIGN(PAGE_SIZE); |
204 | pg0 = . ; | 204 | pg0 = . ; |
205 | } | 205 | } |
206 | 206 | ||
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S index 0992b9946c6f..5e9ec1b33c10 100644 --- a/arch/x86/kernel/vmlinux_64.lds.S +++ b/arch/x86/kernel/vmlinux_64.lds.S | |||
@@ -37,7 +37,7 @@ SECTIONS | |||
37 | KPROBES_TEXT | 37 | KPROBES_TEXT |
38 | *(.fixup) | 38 | *(.fixup) |
39 | *(.gnu.warning) | 39 | *(.gnu.warning) |
40 | _etext = .; /* End of text section */ | 40 | _etext = .; /* End of text section */ |
41 | } :text = 0x9090 | 41 | } :text = 0x9090 |
42 | 42 | ||
43 | . = ALIGN(16); /* Exception table */ | 43 | . = ALIGN(16); /* Exception table */ |
@@ -60,7 +60,7 @@ SECTIONS | |||
60 | __tracedata_end = .; | 60 | __tracedata_end = .; |
61 | } | 61 | } |
62 | 62 | ||
63 | . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ | 63 | . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ |
64 | /* Data */ | 64 | /* Data */ |
65 | .data : AT(ADDR(.data) - LOAD_OFFSET) { | 65 | .data : AT(ADDR(.data) - LOAD_OFFSET) { |
66 | DATA_DATA | 66 | DATA_DATA |
@@ -119,7 +119,7 @@ SECTIONS | |||
119 | .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3)) | 119 | .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3)) |
120 | { *(.vsyscall_3) } | 120 | { *(.vsyscall_3) } |
121 | 121 | ||
122 | . = VSYSCALL_VIRT_ADDR + 4096; | 122 | . = VSYSCALL_VIRT_ADDR + PAGE_SIZE; |
123 | 123 | ||
124 | #undef VSYSCALL_ADDR | 124 | #undef VSYSCALL_ADDR |
125 | #undef VSYSCALL_PHYS_ADDR | 125 | #undef VSYSCALL_PHYS_ADDR |
@@ -134,23 +134,23 @@ SECTIONS | |||
134 | *(.data.init_task) | 134 | *(.data.init_task) |
135 | }:data.init | 135 | }:data.init |
136 | 136 | ||
137 | . = ALIGN(4096); | 137 | . = ALIGN(PAGE_SIZE); |
138 | .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { | 138 | .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { |
139 | *(.data.page_aligned) | 139 | *(.data.page_aligned) |
140 | } | 140 | } |
141 | 141 | ||
142 | /* might get freed after init */ | 142 | /* might get freed after init */ |
143 | . = ALIGN(4096); | 143 | . = ALIGN(PAGE_SIZE); |
144 | __smp_alt_begin = .; | 144 | __smp_alt_begin = .; |
145 | __smp_locks = .; | 145 | __smp_locks = .; |
146 | .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { | 146 | .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { |
147 | *(.smp_locks) | 147 | *(.smp_locks) |
148 | } | 148 | } |
149 | __smp_locks_end = .; | 149 | __smp_locks_end = .; |
150 | . = ALIGN(4096); | 150 | . = ALIGN(PAGE_SIZE); |
151 | __smp_alt_end = .; | 151 | __smp_alt_end = .; |
152 | 152 | ||
153 | . = ALIGN(4096); /* Init code and data */ | 153 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
154 | __init_begin = .; | 154 | __init_begin = .; |
155 | .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { | 155 | .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { |
156 | _sinittext = .; | 156 | _sinittext = .; |
@@ -191,7 +191,7 @@ SECTIONS | |||
191 | .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) { | 191 | .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) { |
192 | *(.altinstructions) | 192 | *(.altinstructions) |
193 | } | 193 | } |
194 | __alt_instructions_end = .; | 194 | __alt_instructions_end = .; |
195 | .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) { | 195 | .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) { |
196 | *(.altinstr_replacement) | 196 | *(.altinstr_replacement) |
197 | } | 197 | } |
@@ -207,25 +207,25 @@ SECTIONS | |||
207 | /* vdso blob that is mapped into user space */ | 207 | /* vdso blob that is mapped into user space */ |
208 | vdso_start = . ; | 208 | vdso_start = . ; |
209 | .vdso : AT(ADDR(.vdso) - LOAD_OFFSET) { *(.vdso) } | 209 | .vdso : AT(ADDR(.vdso) - LOAD_OFFSET) { *(.vdso) } |
210 | . = ALIGN(4096); | 210 | . = ALIGN(PAGE_SIZE); |
211 | vdso_end = .; | 211 | vdso_end = .; |
212 | 212 | ||
213 | #ifdef CONFIG_BLK_DEV_INITRD | 213 | #ifdef CONFIG_BLK_DEV_INITRD |
214 | . = ALIGN(4096); | 214 | . = ALIGN(PAGE_SIZE); |
215 | __initramfs_start = .; | 215 | __initramfs_start = .; |
216 | .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) } | 216 | .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) } |
217 | __initramfs_end = .; | 217 | __initramfs_end = .; |
218 | #endif | 218 | #endif |
219 | 219 | ||
220 | PERCPU(4096) | 220 | PERCPU(PAGE_SIZE) |
221 | 221 | ||
222 | . = ALIGN(4096); | 222 | . = ALIGN(PAGE_SIZE); |
223 | __init_end = .; | 223 | __init_end = .; |
224 | 224 | ||
225 | . = ALIGN(4096); | 225 | . = ALIGN(PAGE_SIZE); |
226 | __nosave_begin = .; | 226 | __nosave_begin = .; |
227 | .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) } | 227 | .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) } |
228 | . = ALIGN(4096); | 228 | . = ALIGN(PAGE_SIZE); |
229 | __nosave_end = .; | 229 | __nosave_end = .; |
230 | 230 | ||
231 | __bss_start = .; /* BSS */ | 231 | __bss_start = .; /* BSS */ |