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