Blackfin arch: unify the duplicated portions of __start and split mach-specific piece...
[linux-2.6-block.git] / arch / blackfin / kernel / vmlinux.lds.S
CommitLineData
1394f032
BW
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:
de6a9520 10 * Copyright 2004-2007 Analog Devices Inc.
1394f032
BW
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>
520473b0 34#include <asm/page.h>
0fa63ad7 35#include <asm/thread_info.h>
1394f032 36
1394f032
BW
37OUTPUT_FORMAT("elf32-bfin")
38ENTRY(__start)
39_jiffies = _jiffies_64;
40
1394f032
BW
41SECTIONS
42{
43 . = CONFIG_BOOT_LOAD;
b7627acc
MF
44 /* Neither the text, ro_data or bss section need to be aligned
45 * So pack them back to back
46 */
1394f032
BW
47 .text :
48 {
de6a9520
MF
49 __text = .;
50 _text = .;
51 __stext = .;
7664709b 52 TEXT_TEXT
1394f032 53 SCHED_TEXT
de6a9520 54 LOCK_TEXT
27d875f2
MF
55 KPROBES_TEXT
56 *(.text.*)
de6a9520
MF
57 *(.fixup)
58
bc6e0fa1
MF
59#if !L1_CODE_LENGTH
60 *(.l1.text)
61#endif
62
1394f032 63 . = ALIGN(16);
de6a9520 64 ___start___ex_table = .;
1394f032 65 *(__ex_table)
de6a9520 66 ___stop___ex_table = .;
1394f032 67
1394f032 68 __etext = .;
de6a9520
MF
69 }
70
b7627acc
MF
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)
bc6e0fa1
MF
80#if !L1_DATA_A_LENGTH
81 *(.l1.bss)
82#endif
83#if !L1_DATA_B_LENGTH
84 *(.l1.bss.B)
85#endif
13752046 86 . = ALIGN(4);
b7627acc
MF
87 ___bss_stop = .;
88 }
de6a9520
MF
89
90 .data :
91 {
92 __sdata = .;
b7627acc 93 /* This gets done first, so the glob doesn't suck it in */
de6a9520
MF
94 . = ALIGN(32);
95 *(.data.cacheline_aligned)
96
b85b82d9
SZ
97#if !L1_DATA_A_LENGTH
98 . = ALIGN(32);
99 *(.data_l1.cacheline_aligned)
bc6e0fa1
MF
100 *(.l1.data)
101#endif
102#if !L1_DATA_B_LENGTH
103 *(.l1.data.B)
b85b82d9 104#endif
262c3825
SZ
105#ifndef L2_LENGTH
106 . = ALIGN(32);
107 *(.data_l2.cacheline_aligned)
108 *(.l2.data)
109#endif
b85b82d9 110
27d875f2
MF
111 DATA_DATA
112 *(.data.*)
113 CONSTRUCTORS
114
b7627acc
MF
115 /* make sure the init_task is aligned to the
116 * kernel thread size so we can locate the kernel
117 * stack properly and quickly.
118 */
0fa63ad7 119 . = ALIGN(THREAD_SIZE);
b7627acc
MF
120 *(.init_task.data)
121
de6a9520
MF
122 __edata = .;
123 }
1394f032 124
b7627acc
MF
125 /* The init section should be last, so when we free it, it goes into
126 * the general memory pool, and (hopefully) will decrease fragmentation
127 * a tiny bit. The init section has a _requirement_ that it be
128 * PAGE_SIZE aligned
129 */
130 . = ALIGN(PAGE_SIZE);
de6a9520 131 ___init_begin = .;
27d875f2
MF
132
133 .init.text :
1394f032 134 {
0fa63ad7 135 . = ALIGN(PAGE_SIZE);
1394f032 136 __sinittext = .;
01ba2bdc 137 INIT_TEXT
1394f032 138 __einittext = .;
27d875f2
MF
139 }
140 .init.data :
141 {
142 . = ALIGN(16);
01ba2bdc 143 INIT_DATA
27d875f2
MF
144 }
145 .init.setup :
146 {
1394f032
BW
147 . = ALIGN(16);
148 ___setup_start = .;
149 *(.init.setup)
150 ___setup_end = .;
27d875f2
MF
151 }
152 .initcall.init :
153 {
1394f032
BW
154 ___initcall_start = .;
155 INITCALLS
156 ___initcall_end = .;
27d875f2
MF
157 }
158 .con_initcall.init :
159 {
1394f032
BW
160 ___con_initcall_start = .;
161 *(.con_initcall.init)
162 ___con_initcall_end = .;
27d875f2
MF
163 }
164 SECURITY_INIT
165 .init.ramfs :
166 {
1394f032
BW
167 . = ALIGN(4);
168 ___initramfs_start = .;
169 *(.init.ramfs)
170 ___initramfs_end = .;
de6a9520 171 }
1394f032 172
de6a9520 173 __l1_lma_start = .;
1394f032 174
27d875f2 175 .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
1394f032
BW
176 {
177 . = ALIGN(4);
de6a9520 178 __stext_l1 = .;
bc6e0fa1 179 *(.l1.text)
1394f032 180 . = ALIGN(4);
de6a9520
MF
181 __etext_l1 = .;
182 }
1394f032 183
de6a9520 184 .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
1394f032
BW
185 {
186 . = ALIGN(4);
de6a9520 187 __sdata_l1 = .;
bc6e0fa1 188 *(.l1.data)
de6a9520 189 __edata_l1 = .;
1394f032 190
1394f032 191 . = ALIGN(32);
bc6e0fa1 192 *(.data_l1.cacheline_aligned)
1394f032 193
262c3825
SZ
194 . = ALIGN(4);
195 __sbss_l1 = .;
196 *(.l1.bss)
1394f032 197 . = ALIGN(4);
de6a9520
MF
198 __ebss_l1 = .;
199 }
200
201 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
1394f032
BW
202 {
203 . = ALIGN(4);
204 __sdata_b_l1 = .;
bc6e0fa1 205 *(.l1.data.B)
1394f032
BW
206 __edata_b_l1 = .;
207
208 . = ALIGN(4);
209 __sbss_b_l1 = .;
bc6e0fa1 210 *(.l1.bss.B)
1394f032
BW
211 . = ALIGN(4);
212 __ebss_b_l1 = .;
de6a9520 213 }
1394f032 214
262c3825
SZ
215#ifdef L2_LENGTH
216 __l2_lma_start = .;
217
218 .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
219 {
220 . = ALIGN(4);
221 __stext_l2 = .;
222 *(.l1.text)
223 . = ALIGN(4);
224 __etext_l2 = .;
225
226 . = ALIGN(4);
227 __sdata_l2 = .;
228 *(.l1.data)
229 __edata_l2 = .;
230
231 . = ALIGN(32);
232 *(.data_l2.cacheline_aligned)
233
234 . = ALIGN(4);
235 __sbss_l2 = .;
236 *(.l1.bss)
237 . = ALIGN(4);
238 __ebss_l2 = .;
239 }
240#endif
241
36208059
MF
242 /* Force trailing alignment of our init section so that when we
243 * free our init memory, we don't leave behind a partial page.
244 */
245 . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
246 . = ALIGN(PAGE_SIZE);
247 ___init_end = .;
248
b7627acc 249 __end =.;
de6a9520 250
c11b5776
MF
251 STABS_DEBUG
252
253 DWARF_DEBUG
254
de6a9520
MF
255 /DISCARD/ :
256 {
01ba2bdc
SR
257 EXIT_TEXT
258 EXIT_DATA
de6a9520
MF
259 *(.exitcall.exit)
260 }
1394f032 261}