x86: Add NMI types for kmap_atomic, fix
[sfrench/cifs-2.6.git] / arch / blackfin / kernel / vmlinux.lds.S
1 /*
2  * File:         arch/blackfin/kernel/vmlinux.lds.S
3  * Based on:     none - original work
4  * Author:
5  *
6  * Created:      Tue Sep 21 2004
7  * Description:  Master linker script for blackfin architecture
8  *
9  * Modified:
10  *               Copyright 2004-2007 Analog Devices Inc.
11  *
12  * Bugs:         Enter bugs at http://blackfin.uclinux.org/
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, see the file COPYING, or write
26  * to the Free Software Foundation, Inc.,
27  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
28  */
29
30 #define VMLINUX_SYMBOL(_sym_) _##_sym_
31
32 #include <asm-generic/vmlinux.lds.h>
33 #include <asm/mem_map.h>
34 #include <asm/page.h>
35 #include <asm/thread_info.h>
36
37 OUTPUT_FORMAT("elf32-bfin")
38 ENTRY(__start)
39 _jiffies = _jiffies_64;
40
41 SECTIONS
42 {
43         . = CONFIG_BOOT_LOAD;
44         /* Neither the text, ro_data or bss section need to be aligned
45          * So pack them back to back
46          */
47         .text :
48         {
49                 __text = .;
50                 _text = .;
51                 __stext = .;
52                 TEXT_TEXT
53 #ifndef CONFIG_SCHEDULE_L1
54                 SCHED_TEXT
55 #endif
56                 LOCK_TEXT
57                 KPROBES_TEXT
58                 *(.text.*)
59                 *(.fixup)
60
61 #if !L1_CODE_LENGTH
62                 *(.l1.text)
63 #endif
64
65                 . = ALIGN(16);
66                 ___start___ex_table = .;
67                 *(__ex_table)
68                 ___stop___ex_table = .;
69
70                 __etext = .;
71         }
72
73         NOTES
74
75         /* Just in case the first read only is a 32-bit access */
76         RO_DATA(4)
77
78         .bss :
79         {
80                 . = ALIGN(4);
81                 ___bss_start = .;
82                 *(.bss .bss.*)
83                 *(COMMON)
84 #if !L1_DATA_A_LENGTH
85                 *(.l1.bss)
86 #endif
87 #if !L1_DATA_B_LENGTH
88                 *(.l1.bss.B)
89 #endif
90                 . = ALIGN(4);
91                 ___bss_stop = .;
92         }
93
94         .data :
95         {
96                 __sdata = .;
97                 /* This gets done first, so the glob doesn't suck it in */
98                 . = ALIGN(32);
99                 *(.data.cacheline_aligned)
100
101 #if !L1_DATA_A_LENGTH
102                 . = ALIGN(32);
103                 *(.data_l1.cacheline_aligned)
104                 *(.l1.data)
105 #endif
106 #if !L1_DATA_B_LENGTH
107                 *(.l1.data.B)
108 #endif
109 #if !L2_LENGTH
110                 . = ALIGN(32);
111                 *(.data_l2.cacheline_aligned)
112                 *(.l2.data)
113 #endif
114
115                 DATA_DATA
116                 CONSTRUCTORS
117
118                 /* make sure the init_task is aligned to the
119                  * kernel thread size so we can locate the kernel
120                  * stack properly and quickly.
121                  */
122                 . = ALIGN(THREAD_SIZE);
123                 *(.init_task.data)
124
125                 __edata = .;
126         }
127
128         /* The init section should be last, so when we free it, it goes into
129          * the general memory pool, and (hopefully) will decrease fragmentation
130          * a tiny bit. The init section has a _requirement_ that it be
131          * PAGE_SIZE aligned
132          */
133         . = ALIGN(PAGE_SIZE);
134         ___init_begin = .;
135
136         .init.text :
137         {
138                 . = ALIGN(PAGE_SIZE);
139                 __sinittext = .;
140                 INIT_TEXT
141                 __einittext = .;
142         }
143         .init.data :
144         {
145                 . = ALIGN(16);
146                 INIT_DATA
147         }
148         .init.setup :
149         {
150                 . = ALIGN(16);
151                 ___setup_start = .;
152                 *(.init.setup)
153                 ___setup_end = .;
154         }
155         .initcall.init :
156         {
157                 ___initcall_start = .;
158                 INITCALLS
159                 ___initcall_end = .;
160         }
161         .con_initcall.init :
162         {
163                 ___con_initcall_start = .;
164                 *(.con_initcall.init)
165                 ___con_initcall_end = .;
166         }
167         PERCPU(4)
168         SECURITY_INIT
169         .init.ramfs :
170         {
171                 . = ALIGN(4);
172                 ___initramfs_start = .;
173                 *(.init.ramfs)
174                 . = ALIGN(4);
175                 ___initramfs_end = .;
176         }
177
178         __l1_lma_start = .;
179
180         .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
181         {
182                 . = ALIGN(4);
183                 __stext_l1 = .;
184                 *(.l1.text)
185 #ifdef CONFIG_SCHEDULE_L1
186                 SCHED_TEXT
187 #endif
188                 . = ALIGN(4);
189                 __etext_l1 = .;
190         }
191         ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
192
193         .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
194         {
195                 . = ALIGN(4);
196                 __sdata_l1 = .;
197                 *(.l1.data)
198                 __edata_l1 = .;
199
200                 . = ALIGN(32);
201                 *(.data_l1.cacheline_aligned)
202
203                 . = ALIGN(4);
204                 __sbss_l1 = .;
205                 *(.l1.bss)
206                 . = ALIGN(4);
207                 __ebss_l1 = .;
208         }
209         ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
210
211         .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
212         {
213                 . = ALIGN(4);
214                 __sdata_b_l1 = .;
215                 *(.l1.data.B)
216                 __edata_b_l1 = .;
217
218                 . = ALIGN(4);
219                 __sbss_b_l1 = .;
220                 *(.l1.bss.B)
221                 . = ALIGN(4);
222                 __ebss_b_l1 = .;
223         }
224         ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
225
226         __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
227
228         .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
229         {
230                 . = ALIGN(4);
231                 __stext_l2 = .;
232                 *(.l2.text)
233                 . = ALIGN(4);
234                 __etext_l2 = .;
235
236                 . = ALIGN(4);
237                 __sdata_l2 = .;
238                 *(.l2.data)
239                 __edata_l2 = .;
240
241                 . = ALIGN(32);
242                 *(.data_l2.cacheline_aligned)
243
244                 . = ALIGN(4);
245                 __sbss_l2 = .;
246                 *(.l2.bss)
247                 . = ALIGN(4);
248                 __ebss_l2 = .;
249         }
250         ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!")
251
252         /* Force trailing alignment of our init section so that when we
253          * free our init memory, we don't leave behind a partial page.
254          */
255         . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
256         . = ALIGN(PAGE_SIZE);
257         ___init_end = .;
258
259         __end =.;
260
261         STABS_DEBUG
262
263         DWARF_DEBUG
264
265         /DISCARD/ :
266         {
267                 EXIT_TEXT
268                 EXIT_DATA
269                 *(.exitcall.exit)
270         }
271 }