Merge git://git.infradead.org/battery-2.6
[pandora-kernel.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                 IRQENTRY_TEXT
58                 KPROBES_TEXT
59                 *(.text.*)
60                 *(.fixup)
61
62 #if !L1_CODE_LENGTH
63                 *(.l1.text)
64 #endif
65
66                 . = ALIGN(16);
67                 ___start___ex_table = .;
68                 *(__ex_table)
69                 ___stop___ex_table = .;
70
71                 __etext = .;
72         }
73
74         NOTES
75
76         /* Just in case the first read only is a 32-bit access */
77         RO_DATA(4)
78
79         .bss :
80         {
81                 . = ALIGN(4);
82                 ___bss_start = .;
83                 *(.bss .bss.*)
84                 *(COMMON)
85 #if !L1_DATA_A_LENGTH
86                 *(.l1.bss)
87 #endif
88 #if !L1_DATA_B_LENGTH
89                 *(.l1.bss.B)
90 #endif
91                 . = ALIGN(4);
92                 ___bss_stop = .;
93         }
94
95         .data :
96         {
97                 __sdata = .;
98                 /* This gets done first, so the glob doesn't suck it in */
99                 . = ALIGN(32);
100                 *(.data.cacheline_aligned)
101
102 #if !L1_DATA_A_LENGTH
103                 . = ALIGN(32);
104                 *(.data_l1.cacheline_aligned)
105                 *(.l1.data)
106 #endif
107 #if !L1_DATA_B_LENGTH
108                 *(.l1.data.B)
109 #endif
110 #if !L2_LENGTH
111                 . = ALIGN(32);
112                 *(.data_l2.cacheline_aligned)
113                 *(.l2.data)
114 #endif
115
116                 DATA_DATA
117                 CONSTRUCTORS
118
119                 /* make sure the init_task is aligned to the
120                  * kernel thread size so we can locate the kernel
121                  * stack properly and quickly.
122                  */
123                 . = ALIGN(THREAD_SIZE);
124                 *(.init_task.data)
125
126                 __edata = .;
127         }
128
129         /* The init section should be last, so when we free it, it goes into
130          * the general memory pool, and (hopefully) will decrease fragmentation
131          * a tiny bit. The init section has a _requirement_ that it be
132          * PAGE_SIZE aligned
133          */
134         . = ALIGN(PAGE_SIZE);
135         ___init_begin = .;
136
137         .init.text :
138         {
139                 . = ALIGN(PAGE_SIZE);
140                 __sinittext = .;
141                 INIT_TEXT
142                 __einittext = .;
143         }
144         .init.data :
145         {
146                 . = ALIGN(16);
147                 INIT_DATA
148         }
149         .init.setup :
150         {
151                 . = ALIGN(16);
152                 ___setup_start = .;
153                 *(.init.setup)
154                 ___setup_end = .;
155         }
156         .initcall.init :
157         {
158                 ___initcall_start = .;
159                 INITCALLS
160                 ___initcall_end = .;
161         }
162         .con_initcall.init :
163         {
164                 ___con_initcall_start = .;
165                 *(.con_initcall.init)
166                 ___con_initcall_end = .;
167         }
168         PERCPU(4)
169         SECURITY_INIT
170
171         /* we have to discard exit text and such at runtime, not link time, to
172          * handle embedded cross-section references (alt instructions, bug
173          * table, eh_frame, etc...)
174          */
175         .exit.text :
176         {
177                 EXIT_TEXT
178         }
179         .exit.data :
180         {
181                 EXIT_DATA
182         }
183
184         .init.ramfs :
185         {
186                 . = ALIGN(4);
187                 ___initramfs_start = .;
188                 *(.init.ramfs)
189                 . = ALIGN(4);
190                 ___initramfs_end = .;
191         }
192
193         __l1_lma_start = .;
194
195         .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
196         {
197                 . = ALIGN(4);
198                 __stext_l1 = .;
199                 *(.l1.text)
200 #ifdef CONFIG_SCHEDULE_L1
201                 SCHED_TEXT
202 #endif
203                 . = ALIGN(4);
204                 __etext_l1 = .;
205         }
206         ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
207
208         .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
209         {
210                 . = ALIGN(4);
211                 __sdata_l1 = .;
212                 *(.l1.data)
213                 __edata_l1 = .;
214
215                 . = ALIGN(32);
216                 *(.data_l1.cacheline_aligned)
217
218                 . = ALIGN(4);
219                 __sbss_l1 = .;
220                 *(.l1.bss)
221                 . = ALIGN(4);
222                 __ebss_l1 = .;
223         }
224         ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
225
226         .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
227         {
228                 . = ALIGN(4);
229                 __sdata_b_l1 = .;
230                 *(.l1.data.B)
231                 __edata_b_l1 = .;
232
233                 . = ALIGN(4);
234                 __sbss_b_l1 = .;
235                 *(.l1.bss.B)
236                 . = ALIGN(4);
237                 __ebss_b_l1 = .;
238         }
239         ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
240
241         __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
242
243         .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
244         {
245                 . = ALIGN(4);
246                 __stext_l2 = .;
247                 *(.l2.text)
248                 . = ALIGN(4);
249                 __etext_l2 = .;
250
251                 . = ALIGN(4);
252                 __sdata_l2 = .;
253                 *(.l2.data)
254                 __edata_l2 = .;
255
256                 . = ALIGN(32);
257                 *(.data_l2.cacheline_aligned)
258
259                 . = ALIGN(4);
260                 __sbss_l2 = .;
261                 *(.l2.bss)
262                 . = ALIGN(4);
263                 __ebss_l2 = .;
264         }
265         ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!")
266
267         /* Force trailing alignment of our init section so that when we
268          * free our init memory, we don't leave behind a partial page.
269          */
270         . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
271         . = ALIGN(PAGE_SIZE);
272         ___init_end = .;
273
274         __end =.;
275
276         STABS_DEBUG
277
278         DWARF_DEBUG
279
280         /DISCARD/ :
281         {
282                 *(.exitcall.exit)
283         }
284 }