aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2009-04-29 03:47:17 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-29 04:20:29 -0400
commitaee6a166a5401dcfcb17fcdc055e5edf2a4f4042 (patch)
tree69afcce990319fcc0b767bac5cd666ffa4e04832
parent51b26ada79b605ed709ddcedbb6012e8f8e0ebed (diff)
x86: beautify vmlinux_32.lds.S
Beautify vmlinux_32.lds.S: - Use tabs for indent - Located curly braces like in C code - Rearranged a few comments To see actual differences use "git diff -b" which ignore 'whitespace' changes. The beautification is done to prepare a unification of the _32 and _64 variants of the linker scripts. [ Impact: cleanup ] 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-1-git-send-email-sam@ravnborg.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/vmlinux_32.lds.S376
1 files changed, 200 insertions, 176 deletions
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 62ad500d55f3..fffa45a1036f 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -22,196 +22,220 @@ ENTRY(phys_startup_32)
22jiffies = jiffies_64; 22jiffies = jiffies_64;
23 23
24PHDRS { 24PHDRS {
25 text PT_LOAD FLAGS(5); /* R_E */ 25 text PT_LOAD FLAGS(5); /* R_E */
26 data PT_LOAD FLAGS(7); /* RWE */ 26 data PT_LOAD FLAGS(7); /* RWE */
27 note PT_NOTE FLAGS(0); /* ___ */ 27 note PT_NOTE FLAGS(0); /* ___ */
28} 28}
29SECTIONS 29SECTIONS
30{ 30{
31 . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR; 31 . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
32 phys_startup_32 = startup_32 - LOAD_OFFSET; 32 phys_startup_32 = startup_32 - LOAD_OFFSET;
33 33
34 .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) { 34 /* Text and read-only data */
35 _text = .; /* Text and read-only data */ 35 .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
36 *(.text.head) 36 _text = .;
37 } :text = 0x9090 37 *(.text.head)
38 38 } :text = 0x9090
39 /* read-only */ 39
40 .text : AT(ADDR(.text) - LOAD_OFFSET) { 40 /* read-only */
41 . = ALIGN(PAGE_SIZE); /* not really needed, already page aligned */ 41 .text : AT(ADDR(.text) - LOAD_OFFSET) {
42 *(.text.page_aligned) 42 /* not really needed, already page aligned */
43 TEXT_TEXT 43 . = ALIGN(PAGE_SIZE);
44 SCHED_TEXT 44 *(.text.page_aligned)
45 LOCK_TEXT 45 TEXT_TEXT
46 KPROBES_TEXT 46 SCHED_TEXT
47 IRQENTRY_TEXT 47 LOCK_TEXT
48 *(.fixup) 48 KPROBES_TEXT
49 *(.gnu.warning) 49 IRQENTRY_TEXT
50 _etext = .; /* End of text section */ 50 *(.fixup)
51 } :text = 0x9090 51 *(.gnu.warning)
52 52 /* End of text section */
53 NOTES :text :note 53 _etext = .;
54 54 } :text = 0x9090
55 . = ALIGN(16); /* Exception table */ 55
56 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { 56 NOTES :text :note
57 __start___ex_table = .; 57
58 *(__ex_table) 58 /* Exception table */
59 __stop___ex_table = .; 59 . = ALIGN(16);
60 } :text = 0x9090 60 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
61 61 __start___ex_table = .;
62 RODATA 62 *(__ex_table)
63 63 __stop___ex_table = .;
64 /* writeable */ 64 } :text = 0x9090
65 . = ALIGN(PAGE_SIZE); 65
66 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ 66 RODATA
67 DATA_DATA 67
68 CONSTRUCTORS 68 /* writeable */
69 . = ALIGN(PAGE_SIZE);
70 /* Data */
71 .data : AT(ADDR(.data) - LOAD_OFFSET) {
72 DATA_DATA
73 CONSTRUCTORS
69 } :data 74 } :data
70 75
71 . = ALIGN(PAGE_SIZE); 76 . = ALIGN(PAGE_SIZE);
72 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { 77 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
73 __nosave_begin = .; 78 __nosave_begin = .;
74 *(.data.nosave) 79 *(.data.nosave)
75 . = ALIGN(PAGE_SIZE); 80 . = ALIGN(PAGE_SIZE);
76 __nosave_end = .; 81 __nosave_end = .;
77 } 82 }
78 83
79 . = ALIGN(PAGE_SIZE); 84 . = ALIGN(PAGE_SIZE);
80 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { 85 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
81 *(.data.page_aligned) 86 *(.data.page_aligned)
82 *(.data.idt) 87 *(.data.idt)
83 } 88 }
84 89
85 . = ALIGN(32); 90 . = ALIGN(32);
86 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { 91 .data.cacheline_aligned :
87 *(.data.cacheline_aligned) 92 AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
88 } 93 *(.data.cacheline_aligned)
89 94 }
90 /* rarely changed data like cpu maps */ 95
91 . = ALIGN(32); 96 /* rarely changed data like cpu maps */
92 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { 97 . = ALIGN(32);
93 *(.data.read_mostly) 98 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
94 _edata = .; /* End of data section */ 99 *(.data.read_mostly)
95 } 100
96 101 /* End of data section */
97 . = ALIGN(THREAD_SIZE); /* init_task */ 102 _edata = .;
98 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { 103 }
99 *(.data.init_task) 104
100 } 105 /* init_task */
101 106 . = ALIGN(THREAD_SIZE);
102 /* might get freed after init */ 107 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
103 . = ALIGN(PAGE_SIZE); 108 *(.data.init_task)
104 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { 109 }
105 __smp_locks = .; 110
106 *(.smp_locks) 111 . = ALIGN(PAGE_SIZE);
107 __smp_locks_end = .; 112 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
108 } 113 /* might get freed after init */
109 /* will be freed after init 114 __smp_locks = .;
110 * Following ALIGN() is required to make sure no other data falls on the 115 *(.smp_locks)
111 * same page where __smp_alt_end is pointing as that page might be freed 116 __smp_locks_end = .;
112 * after boot. Always make sure that ALIGN() directive is present after 117 }
113 * the section which contains __smp_alt_end. 118 /* will be freed after init
114 */ 119 * Following ALIGN() is required to make sure no other data falls on the
115 . = ALIGN(PAGE_SIZE); 120 * same page where __smp_alt_end is pointing as that page might be freed
116 121 * after boot. Always make sure that ALIGN() directive is present after
117 /* will be freed after init */ 122 * the section which contains __smp_alt_end.
118 . = ALIGN(PAGE_SIZE); /* Init code and data */ 123 */
119 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { 124 . = ALIGN(PAGE_SIZE);
120 __init_begin = .; 125
121 _sinittext = .; 126 /* Init code and data - will be freed after init */
122 INIT_TEXT 127 . = ALIGN(PAGE_SIZE);
123 _einittext = .; 128 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
124 } 129 __init_begin = .;
125 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { 130 _sinittext = .;
126 INIT_DATA 131 INIT_TEXT
127 } 132 _einittext = .;
128 . = ALIGN(16); 133 }
129 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { 134
130 __setup_start = .; 135 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
131 *(.init.setup) 136 INIT_DATA
132 __setup_end = .; 137 }
133 } 138
134 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { 139 . = ALIGN(16);
135 __initcall_start = .; 140 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
136 INITCALLS 141 __setup_start = .;
137 __initcall_end = .; 142 *(.init.setup)
138 } 143 __setup_end = .;
139 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) { 144 }
140 __con_initcall_start = .; 145 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
141 *(.con_initcall.init) 146 __initcall_start = .;
142 __con_initcall_end = .; 147 INITCALLS
143 } 148 __initcall_end = .;
144 .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) { 149 }
145 __x86_cpu_dev_start = .; 150
146 *(.x86_cpu_dev.init) 151 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
147 __x86_cpu_dev_end = .; 152 __con_initcall_start = .;
148 } 153 *(.con_initcall.init)
149 SECURITY_INIT 154 __con_initcall_end = .;
150 . = ALIGN(4); 155 }
151 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) { 156
152 __alt_instructions = .; 157 .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
153 *(.altinstructions) 158 __x86_cpu_dev_start = .;
154 __alt_instructions_end = .; 159 *(.x86_cpu_dev.init)
155 } 160 __x86_cpu_dev_end = .;
156 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) { 161 }
157 *(.altinstr_replacement) 162
158 } 163 SECURITY_INIT
159 . = ALIGN(4); 164
160 .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) { 165 . = ALIGN(4);
161 __parainstructions = .; 166 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
162 *(.parainstructions) 167 __alt_instructions = .;
163 __parainstructions_end = .; 168 *(.altinstructions)
164 } 169 __alt_instructions_end = .;
165 /* .exit.text is discard at runtime, not link time, to deal with references 170 }
166 from .altinstructions and .eh_frame */ 171
167 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { 172 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
168 EXIT_TEXT 173 *(.altinstr_replacement)
169 } 174 }
170 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { 175
171 EXIT_DATA 176 . = ALIGN(4);
172 } 177 .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
178 __parainstructions = .;
179 *(.parainstructions)
180 __parainstructions_end = .;
181 }
182
183 /*
184 * .exit.text is discard at runtime, not link time, to deal with
185 * references from .altinstructions and .eh_frame
186 */
187 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
188 EXIT_TEXT
189 }
190
191 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) {
192 EXIT_DATA
193 }
194
173#if defined(CONFIG_BLK_DEV_INITRD) 195#if defined(CONFIG_BLK_DEV_INITRD)
174 . = ALIGN(PAGE_SIZE); 196 . = ALIGN(PAGE_SIZE);
175 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { 197 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
176 __initramfs_start = .; 198 __initramfs_start = .;
177 *(.init.ramfs) 199 *(.init.ramfs)
178 __initramfs_end = .; 200 __initramfs_end = .;
179 } 201 }
180#endif 202#endif
181 PERCPU(PAGE_SIZE)
182 . = ALIGN(PAGE_SIZE);
183 /* freed after init ends here */
184
185 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
186 __init_end = .;
187 __bss_start = .; /* BSS */
188 *(.bss.page_aligned)
189 *(.bss)
190 . = ALIGN(4);
191 __bss_stop = .;
192 }
193 203
194 .brk : AT(ADDR(.brk) - LOAD_OFFSET) { 204 PERCPU(PAGE_SIZE)
205
195 . = ALIGN(PAGE_SIZE); 206 . = ALIGN(PAGE_SIZE);
196 __brk_base = . ; 207 /* freed after init ends here */
197 . += 64 * 1024 ; /* 64k alignment slop space */ 208
198 *(.brk_reservation) /* areas brk users have reserved */ 209 /* BSS */
199 __brk_limit = . ; 210 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
200 } 211 __init_end = .;
212 __bss_start = .;
213 *(.bss.page_aligned)
214 *(.bss)
215 . = ALIGN(4);
216 __bss_stop = .;
217 }
201 218
202 .end : AT(ADDR(.end) - LOAD_OFFSET) { 219 .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
203 _end = . ; 220 . = ALIGN(PAGE_SIZE);
204 } 221 __brk_base = .;
222 . += 64 * 1024; /* 64k alignment slop space */
223 *(.brk_reservation) /* areas brk users have reserved */
224 __brk_limit = .;
225 }
205 226
206 /* Sections to be discarded */ 227 .end : AT(ADDR(.end) - LOAD_OFFSET) {
207 /DISCARD/ : { 228 _end = . ;
208 *(.exitcall.exit)
209 *(.discard)
210 } 229 }
211 230
212 STABS_DEBUG 231 /* Sections to be discarded */
232 /DISCARD/ : {
233 *(.exitcall.exit)
234 *(.discard)
235 }
213 236
214 DWARF_DEBUG 237 STABS_DEBUG
238 DWARF_DEBUG
215} 239}
216 240
217/* 241/*