Merge branch 'writeback' of git://git.kernel.dk/linux-2.6-block
[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                 CACHELINE_ALIGNED_DATA(32)
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                 INIT_TASK_DATA(THREAD_SIZE)
119
120                 __edata = .;
121         }
122
123         /* The init section should be last, so when we free it, it goes into
124          * the general memory pool, and (hopefully) will decrease fragmentation
125          * a tiny bit. The init section has a _requirement_ that it be
126          * PAGE_SIZE aligned
127          */
128         . = ALIGN(PAGE_SIZE);
129         ___init_begin = .;
130
131         INIT_TEXT_SECTION(PAGE_SIZE)
132         . = ALIGN(16);
133         INIT_DATA_SECTION(16)
134         PERCPU(4)
135
136         /* we have to discard exit text and such at runtime, not link time, to
137          * handle embedded cross-section references (alt instructions, bug
138          * table, eh_frame, etc...)
139          */
140         .exit.text :
141         {
142                 EXIT_TEXT
143         }
144         .exit.data :
145         {
146                 EXIT_DATA
147         }
148
149         __l1_lma_start = .;
150
151         .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
152         {
153                 . = ALIGN(4);
154                 __stext_l1 = .;
155                 *(.l1.text)
156 #ifdef CONFIG_SCHEDULE_L1
157                 SCHED_TEXT
158 #endif
159                 . = ALIGN(4);
160                 __etext_l1 = .;
161         }
162         ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
163
164         .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
165         {
166                 . = ALIGN(4);
167                 __sdata_l1 = .;
168                 *(.l1.data)
169                 __edata_l1 = .;
170
171                 . = ALIGN(32);
172                 *(.data_l1.cacheline_aligned)
173
174                 . = ALIGN(4);
175                 __sbss_l1 = .;
176                 *(.l1.bss)
177                 . = ALIGN(4);
178                 __ebss_l1 = .;
179         }
180         ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
181
182         .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
183         {
184                 . = ALIGN(4);
185                 __sdata_b_l1 = .;
186                 *(.l1.data.B)
187                 __edata_b_l1 = .;
188
189                 . = ALIGN(4);
190                 __sbss_b_l1 = .;
191                 *(.l1.bss.B)
192                 . = ALIGN(4);
193                 __ebss_b_l1 = .;
194         }
195         ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
196
197         __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
198
199         .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
200         {
201                 . = ALIGN(4);
202                 __stext_l2 = .;
203                 *(.l2.text)
204                 . = ALIGN(4);
205                 __etext_l2 = .;
206
207                 . = ALIGN(4);
208                 __sdata_l2 = .;
209                 *(.l2.data)
210                 __edata_l2 = .;
211
212                 . = ALIGN(32);
213                 *(.data_l2.cacheline_aligned)
214
215                 . = ALIGN(4);
216                 __sbss_l2 = .;
217                 *(.l2.bss)
218                 . = ALIGN(4);
219                 __ebss_l2 = .;
220         }
221         ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!")
222
223         /* Force trailing alignment of our init section so that when we
224          * free our init memory, we don't leave behind a partial page.
225          */
226         . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
227         . = ALIGN(PAGE_SIZE);
228         ___init_end = .;
229
230         __end =.;
231
232         STABS_DEBUG
233
234         DWARF_DEBUG
235
236         DISCARDS
237 }