Commit | Line | Data |
---|---|---|
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 |
37 | OUTPUT_FORMAT("elf32-bfin") |
38 | ENTRY(__start) | |
39 | _jiffies = _jiffies_64; | |
40 | ||
1394f032 BW |
41 | SECTIONS |
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 | ||
6f985294 BS |
71 | NOTES |
72 | ||
b7627acc MF |
73 | /* Just in case the first read only is a 32-bit access */ |
74 | RO_DATA(4) | |
75 | ||
76 | .bss : | |
77 | { | |
78 | . = ALIGN(4); | |
79 | ___bss_start = .; | |
80 | *(.bss .bss.*) | |
81 | *(COMMON) | |
bc6e0fa1 MF |
82 | #if !L1_DATA_A_LENGTH |
83 | *(.l1.bss) | |
84 | #endif | |
85 | #if !L1_DATA_B_LENGTH | |
86 | *(.l1.bss.B) | |
87 | #endif | |
13752046 | 88 | . = ALIGN(4); |
b7627acc MF |
89 | ___bss_stop = .; |
90 | } | |
de6a9520 MF |
91 | |
92 | .data : | |
93 | { | |
94 | __sdata = .; | |
b7627acc | 95 | /* This gets done first, so the glob doesn't suck it in */ |
de6a9520 MF |
96 | . = ALIGN(32); |
97 | *(.data.cacheline_aligned) | |
98 | ||
b85b82d9 SZ |
99 | #if !L1_DATA_A_LENGTH |
100 | . = ALIGN(32); | |
101 | *(.data_l1.cacheline_aligned) | |
bc6e0fa1 MF |
102 | *(.l1.data) |
103 | #endif | |
104 | #if !L1_DATA_B_LENGTH | |
105 | *(.l1.data.B) | |
b85b82d9 | 106 | #endif |
07aa7be5 | 107 | #if !L2_LENGTH |
262c3825 SZ |
108 | . = ALIGN(32); |
109 | *(.data_l2.cacheline_aligned) | |
110 | *(.l2.data) | |
111 | #endif | |
b85b82d9 | 112 | |
27d875f2 | 113 | DATA_DATA |
27d875f2 MF |
114 | CONSTRUCTORS |
115 | ||
b7627acc MF |
116 | /* make sure the init_task is aligned to the |
117 | * kernel thread size so we can locate the kernel | |
118 | * stack properly and quickly. | |
119 | */ | |
0fa63ad7 | 120 | . = ALIGN(THREAD_SIZE); |
b7627acc MF |
121 | *(.init_task.data) |
122 | ||
de6a9520 MF |
123 | __edata = .; |
124 | } | |
1394f032 | 125 | |
b7627acc MF |
126 | /* The init section should be last, so when we free it, it goes into |
127 | * the general memory pool, and (hopefully) will decrease fragmentation | |
128 | * a tiny bit. The init section has a _requirement_ that it be | |
129 | * PAGE_SIZE aligned | |
130 | */ | |
131 | . = ALIGN(PAGE_SIZE); | |
de6a9520 | 132 | ___init_begin = .; |
27d875f2 MF |
133 | |
134 | .init.text : | |
1394f032 | 135 | { |
0fa63ad7 | 136 | . = ALIGN(PAGE_SIZE); |
1394f032 | 137 | __sinittext = .; |
01ba2bdc | 138 | INIT_TEXT |
1394f032 | 139 | __einittext = .; |
27d875f2 MF |
140 | } |
141 | .init.data : | |
142 | { | |
143 | . = ALIGN(16); | |
01ba2bdc | 144 | INIT_DATA |
27d875f2 MF |
145 | } |
146 | .init.setup : | |
147 | { | |
1394f032 BW |
148 | . = ALIGN(16); |
149 | ___setup_start = .; | |
150 | *(.init.setup) | |
151 | ___setup_end = .; | |
27d875f2 MF |
152 | } |
153 | .initcall.init : | |
154 | { | |
1394f032 BW |
155 | ___initcall_start = .; |
156 | INITCALLS | |
157 | ___initcall_end = .; | |
27d875f2 MF |
158 | } |
159 | .con_initcall.init : | |
160 | { | |
1394f032 BW |
161 | ___con_initcall_start = .; |
162 | *(.con_initcall.init) | |
163 | ___con_initcall_end = .; | |
27d875f2 | 164 | } |
46fa5eec | 165 | PERCPU(4) |
27d875f2 MF |
166 | SECURITY_INIT |
167 | .init.ramfs : | |
168 | { | |
1394f032 BW |
169 | . = ALIGN(4); |
170 | ___initramfs_start = .; | |
171 | *(.init.ramfs) | |
6f985294 | 172 | . = ALIGN(4); |
1394f032 | 173 | ___initramfs_end = .; |
de6a9520 | 174 | } |
1394f032 | 175 | |
de6a9520 | 176 | __l1_lma_start = .; |
1394f032 | 177 | |
27d875f2 | 178 | .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs)) |
1394f032 BW |
179 | { |
180 | . = ALIGN(4); | |
de6a9520 | 181 | __stext_l1 = .; |
bc6e0fa1 | 182 | *(.l1.text) |
1394f032 | 183 | . = ALIGN(4); |
de6a9520 MF |
184 | __etext_l1 = .; |
185 | } | |
4636b301 | 186 | ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!") |
1394f032 | 187 | |
de6a9520 | 188 | .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1)) |
1394f032 BW |
189 | { |
190 | . = ALIGN(4); | |
de6a9520 | 191 | __sdata_l1 = .; |
bc6e0fa1 | 192 | *(.l1.data) |
de6a9520 | 193 | __edata_l1 = .; |
1394f032 | 194 | |
1394f032 | 195 | . = ALIGN(32); |
bc6e0fa1 | 196 | *(.data_l1.cacheline_aligned) |
1394f032 | 197 | |
262c3825 SZ |
198 | . = ALIGN(4); |
199 | __sbss_l1 = .; | |
200 | *(.l1.bss) | |
1394f032 | 201 | . = ALIGN(4); |
de6a9520 MF |
202 | __ebss_l1 = .; |
203 | } | |
4636b301 | 204 | ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!") |
de6a9520 MF |
205 | |
206 | .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) | |
1394f032 BW |
207 | { |
208 | . = ALIGN(4); | |
209 | __sdata_b_l1 = .; | |
bc6e0fa1 | 210 | *(.l1.data.B) |
1394f032 BW |
211 | __edata_b_l1 = .; |
212 | ||
213 | . = ALIGN(4); | |
214 | __sbss_b_l1 = .; | |
bc6e0fa1 | 215 | *(.l1.bss.B) |
1394f032 BW |
216 | . = ALIGN(4); |
217 | __ebss_b_l1 = .; | |
de6a9520 | 218 | } |
4636b301 | 219 | ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!") |
1394f032 | 220 | |
6f985294 | 221 | __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); |
262c3825 SZ |
222 | |
223 | .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1)) | |
224 | { | |
225 | . = ALIGN(4); | |
226 | __stext_l2 = .; | |
07aa7be5 | 227 | *(.l2.text) |
262c3825 SZ |
228 | . = ALIGN(4); |
229 | __etext_l2 = .; | |
230 | ||
231 | . = ALIGN(4); | |
232 | __sdata_l2 = .; | |
07aa7be5 | 233 | *(.l2.data) |
262c3825 SZ |
234 | __edata_l2 = .; |
235 | ||
236 | . = ALIGN(32); | |
237 | *(.data_l2.cacheline_aligned) | |
238 | ||
239 | . = ALIGN(4); | |
240 | __sbss_l2 = .; | |
07aa7be5 | 241 | *(.l2.bss) |
262c3825 SZ |
242 | . = ALIGN(4); |
243 | __ebss_l2 = .; | |
244 | } | |
4636b301 | 245 | ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!") |
6f985294 | 246 | |
36208059 MF |
247 | /* Force trailing alignment of our init section so that when we |
248 | * free our init memory, we don't leave behind a partial page. | |
249 | */ | |
6f985294 | 250 | . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2); |
36208059 MF |
251 | . = ALIGN(PAGE_SIZE); |
252 | ___init_end = .; | |
253 | ||
b7627acc | 254 | __end =.; |
de6a9520 | 255 | |
c11b5776 MF |
256 | STABS_DEBUG |
257 | ||
258 | DWARF_DEBUG | |
259 | ||
de6a9520 MF |
260 | /DISCARD/ : |
261 | { | |
01ba2bdc SR |
262 | EXIT_TEXT |
263 | EXIT_DATA | |
de6a9520 MF |
264 | *(.exitcall.exit) |
265 | } | |
1394f032 | 266 | } |