blackfin: Cleanup linker script using new linker script macros.
[linux-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
b8d0c778 53#ifndef CONFIG_SCHEDULE_L1
1394f032 54 SCHED_TEXT
b8d0c778 55#endif
de6a9520 56 LOCK_TEXT
1ee76d7e 57 IRQENTRY_TEXT
27d875f2
MF
58 KPROBES_TEXT
59 *(.text.*)
de6a9520
MF
60 *(.fixup)
61
bc6e0fa1
MF
62#if !L1_CODE_LENGTH
63 *(.l1.text)
64#endif
65
1394f032 66 . = ALIGN(16);
de6a9520 67 ___start___ex_table = .;
1394f032 68 *(__ex_table)
de6a9520 69 ___stop___ex_table = .;
1394f032 70
1394f032 71 __etext = .;
de6a9520
MF
72 }
73
6f985294
BS
74 NOTES
75
b7627acc
MF
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)
bc6e0fa1
MF
85#if !L1_DATA_A_LENGTH
86 *(.l1.bss)
87#endif
88#if !L1_DATA_B_LENGTH
89 *(.l1.bss.B)
90#endif
13752046 91 . = ALIGN(4);
b7627acc
MF
92 ___bss_stop = .;
93 }
de6a9520
MF
94
95 .data :
96 {
97 __sdata = .;
b7627acc 98 /* This gets done first, so the glob doesn't suck it in */
4a5e3513 99 CACHELINE_ALIGNED_DATA(32)
de6a9520 100
b85b82d9
SZ
101#if !L1_DATA_A_LENGTH
102 . = ALIGN(32);
103 *(.data_l1.cacheline_aligned)
bc6e0fa1
MF
104 *(.l1.data)
105#endif
106#if !L1_DATA_B_LENGTH
107 *(.l1.data.B)
b85b82d9 108#endif
07aa7be5 109#if !L2_LENGTH
262c3825
SZ
110 . = ALIGN(32);
111 *(.data_l2.cacheline_aligned)
112 *(.l2.data)
113#endif
b85b82d9 114
27d875f2 115 DATA_DATA
27d875f2
MF
116 CONSTRUCTORS
117
4a5e3513 118 INIT_TASK_DATA(THREAD_SIZE)
b7627acc 119
de6a9520
MF
120 __edata = .;
121 }
1394f032 122
b7627acc
MF
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);
de6a9520 129 ___init_begin = .;
27d875f2 130
4a5e3513
TA
131 INIT_TEXT_SECTION(PAGE_SIZE)
132 . = ALIGN(16);
133 INIT_DATA_SECTION(16)
46fa5eec 134 PERCPU(4)
70f12567
MF
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
de6a9520 149 __l1_lma_start = .;
1394f032 150
4a5e3513 151 .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
1394f032
BW
152 {
153 . = ALIGN(4);
de6a9520 154 __stext_l1 = .;
bc6e0fa1 155 *(.l1.text)
b8d0c778
RG
156#ifdef CONFIG_SCHEDULE_L1
157 SCHED_TEXT
158#endif
1394f032 159 . = ALIGN(4);
de6a9520
MF
160 __etext_l1 = .;
161 }
4636b301 162 ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
1394f032 163
de6a9520 164 .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
1394f032
BW
165 {
166 . = ALIGN(4);
de6a9520 167 __sdata_l1 = .;
bc6e0fa1 168 *(.l1.data)
de6a9520 169 __edata_l1 = .;
1394f032 170
1394f032 171 . = ALIGN(32);
bc6e0fa1 172 *(.data_l1.cacheline_aligned)
1394f032 173
262c3825
SZ
174 . = ALIGN(4);
175 __sbss_l1 = .;
176 *(.l1.bss)
1394f032 177 . = ALIGN(4);
de6a9520
MF
178 __ebss_l1 = .;
179 }
8d7ac69f 180 ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
de6a9520
MF
181
182 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
1394f032
BW
183 {
184 . = ALIGN(4);
185 __sdata_b_l1 = .;
bc6e0fa1 186 *(.l1.data.B)
1394f032
BW
187 __edata_b_l1 = .;
188
189 . = ALIGN(4);
190 __sbss_b_l1 = .;
bc6e0fa1 191 *(.l1.bss.B)
1394f032
BW
192 . = ALIGN(4);
193 __ebss_b_l1 = .;
de6a9520 194 }
4636b301 195 ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
1394f032 196
6f985294 197 __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
262c3825
SZ
198
199 .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
200 {
201 . = ALIGN(4);
202 __stext_l2 = .;
07aa7be5 203 *(.l2.text)
262c3825
SZ
204 . = ALIGN(4);
205 __etext_l2 = .;
206
207 . = ALIGN(4);
208 __sdata_l2 = .;
07aa7be5 209 *(.l2.data)
262c3825
SZ
210 __edata_l2 = .;
211
212 . = ALIGN(32);
213 *(.data_l2.cacheline_aligned)
214
215 . = ALIGN(4);
216 __sbss_l2 = .;
07aa7be5 217 *(.l2.bss)
262c3825
SZ
218 . = ALIGN(4);
219 __ebss_l2 = .;
220 }
8d7ac69f 221 ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!")
6f985294 222
36208059
MF
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 */
6f985294 226 . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
36208059
MF
227 . = ALIGN(PAGE_SIZE);
228 ___init_end = .;
229
b7627acc 230 __end =.;
de6a9520 231
c11b5776
MF
232 STABS_DEBUG
233
234 DWARF_DEBUG
235
023bf6f1 236 DISCARDS
1394f032 237}