nios2: Build infrastructure
[deliverable/linux.git] / arch / blackfin / kernel / vmlinux.lds.S
CommitLineData
1394f032 1/*
96f1050d 2 * Copyright 2004-2009 Analog Devices Inc.
1394f032 3 *
96f1050d 4 * Licensed under the GPL-2 or later
1394f032
BW
5 */
6
1394f032
BW
7#include <asm-generic/vmlinux.lds.h>
8#include <asm/mem_map.h>
520473b0 9#include <asm/page.h>
0fa63ad7 10#include <asm/thread_info.h>
1394f032 11
1394f032
BW
12OUTPUT_FORMAT("elf32-bfin")
13ENTRY(__start)
14_jiffies = _jiffies_64;
15
1394f032
BW
16SECTIONS
17{
d86bfb16 18#ifdef CONFIG_RAMKERNEL
1394f032 19 . = CONFIG_BOOT_LOAD;
d86bfb16
BS
20#else
21 . = CONFIG_ROM_BASE;
22#endif
23
b7627acc
MF
24 /* Neither the text, ro_data or bss section need to be aligned
25 * So pack them back to back
26 */
1394f032
BW
27 .text :
28 {
de6a9520
MF
29 __text = .;
30 _text = .;
31 __stext = .;
7664709b 32 TEXT_TEXT
b8d0c778 33#ifndef CONFIG_SCHEDULE_L1
1394f032 34 SCHED_TEXT
b8d0c778 35#endif
de6a9520 36 LOCK_TEXT
1ee76d7e 37 IRQENTRY_TEXT
27d875f2 38 KPROBES_TEXT
d86bfb16
BS
39#ifdef CONFIG_ROMKERNEL
40 __sinittext = .;
41 INIT_TEXT
42 __einittext = .;
43 EXIT_TEXT
44#endif
27d875f2 45 *(.text.*)
de6a9520
MF
46 *(.fixup)
47
bc6e0fa1
MF
48#if !L1_CODE_LENGTH
49 *(.l1.text)
50#endif
1394f032 51 __etext = .;
de6a9520
MF
52 }
53
d49e8e7e 54 EXCEPTION_TABLE(4)
6f985294
BS
55 NOTES
56
b7627acc
MF
57 /* Just in case the first read only is a 32-bit access */
58 RO_DATA(4)
d86bfb16 59 __rodata_end = .;
b7627acc 60
d86bfb16
BS
61#ifdef CONFIG_ROMKERNEL
62 . = CONFIG_BOOT_LOAD;
63 .bss : AT(__rodata_end)
64#else
b7627acc 65 .bss :
d86bfb16 66#endif
b7627acc
MF
67 {
68 . = ALIGN(4);
69 ___bss_start = .;
70 *(.bss .bss.*)
71 *(COMMON)
bc6e0fa1
MF
72#if !L1_DATA_A_LENGTH
73 *(.l1.bss)
74#endif
75#if !L1_DATA_B_LENGTH
76 *(.l1.bss.B)
77#endif
13752046 78 . = ALIGN(4);
b7627acc
MF
79 ___bss_stop = .;
80 }
de6a9520 81
d86bfb16
BS
82#if defined(CONFIG_ROMKERNEL)
83 .data : AT(LOADADDR(.bss) + SIZEOF(.bss))
84#else
de6a9520 85 .data :
d86bfb16 86#endif
de6a9520
MF
87 {
88 __sdata = .;
b7627acc 89 /* This gets done first, so the glob doesn't suck it in */
4a5e3513 90 CACHELINE_ALIGNED_DATA(32)
de6a9520 91
b85b82d9
SZ
92#if !L1_DATA_A_LENGTH
93 . = ALIGN(32);
94 *(.data_l1.cacheline_aligned)
bc6e0fa1
MF
95 *(.l1.data)
96#endif
97#if !L1_DATA_B_LENGTH
98 *(.l1.data.B)
b85b82d9 99#endif
07aa7be5 100#if !L2_LENGTH
262c3825
SZ
101 . = ALIGN(32);
102 *(.data_l2.cacheline_aligned)
103 *(.l2.data)
104#endif
b85b82d9 105
27d875f2 106 DATA_DATA
27d875f2
MF
107 CONSTRUCTORS
108
4a5e3513 109 INIT_TASK_DATA(THREAD_SIZE)
b7627acc 110
de6a9520
MF
111 __edata = .;
112 }
d86bfb16
BS
113 __data_lma = LOADADDR(.data);
114 __data_len = SIZEOF(.data);
1394f032 115
b7627acc
MF
116 /* The init section should be last, so when we free it, it goes into
117 * the general memory pool, and (hopefully) will decrease fragmentation
118 * a tiny bit. The init section has a _requirement_ that it be
119 * PAGE_SIZE aligned
120 */
121 . = ALIGN(PAGE_SIZE);
de6a9520 122 ___init_begin = .;
27d875f2 123
d86bfb16 124#ifdef CONFIG_RAMKERNEL
4a5e3513 125 INIT_TEXT_SECTION(PAGE_SIZE)
70f12567 126
0afc272c 127 /* We have to discard exit text and such at runtime, not link time, to
70f12567 128 * handle embedded cross-section references (alt instructions, bug
0afc272c
JZ
129 * table, eh_frame, etc...). We need all of our .text up front and
130 * .data after it for PCREL call issues.
70f12567
MF
131 */
132 .exit.text :
133 {
134 EXIT_TEXT
135 }
0afc272c
JZ
136
137 . = ALIGN(16);
138 INIT_DATA_SECTION(16)
0415b00d 139 PERCPU_SECTION(32)
0afc272c 140
70f12567
MF
141 .exit.data :
142 {
143 EXIT_DATA
144 }
145
4a5e3513 146 .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
d86bfb16 147#else
b76f9823 148 .init.data : AT(__data_lma + __data_len + 32)
d86bfb16
BS
149 {
150 __sinitdata = .;
151 INIT_DATA
152 INIT_SETUP(16)
153 INIT_CALLS
154 CON_INITCALL
155 SECURITY_INITCALL
156 INIT_RAM_FS
157
353470cc 158 . = ALIGN(PAGE_SIZE);
d86bfb16 159 ___per_cpu_load = .;
d6cb2e3a 160 PERCPU_INPUT(32)
d86bfb16
BS
161
162 EXIT_DATA
163 __einitdata = .;
164 }
165 __init_data_lma = LOADADDR(.init.data);
166 __init_data_len = SIZEOF(.init.data);
167 __init_data_end = .;
168
169 .text_l1 L1_CODE_START : AT(__init_data_lma + __init_data_len)
170#endif
1394f032
BW
171 {
172 . = ALIGN(4);
de6a9520 173 __stext_l1 = .;
c6345ab1 174 *(.l1.text.head)
bc6e0fa1 175 *(.l1.text)
b8d0c778
RG
176#ifdef CONFIG_SCHEDULE_L1
177 SCHED_TEXT
178#endif
1394f032 179 . = ALIGN(4);
de6a9520
MF
180 __etext_l1 = .;
181 }
5cd82a6d
MF
182 __text_l1_lma = LOADADDR(.text_l1);
183 __text_l1_len = SIZEOF(.text_l1);
184 ASSERT (__text_l1_len <= L1_CODE_LENGTH, "L1 text overflow!")
1394f032 185
5cd82a6d 186 .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len)
1394f032
BW
187 {
188 . = ALIGN(4);
de6a9520 189 __sdata_l1 = .;
bc6e0fa1 190 *(.l1.data)
de6a9520 191 __edata_l1 = .;
1394f032 192
1394f032 193 . = ALIGN(32);
bc6e0fa1 194 *(.data_l1.cacheline_aligned)
1394f032 195
262c3825
SZ
196 . = ALIGN(4);
197 __sbss_l1 = .;
198 *(.l1.bss)
1394f032 199 . = ALIGN(4);
de6a9520
MF
200 __ebss_l1 = .;
201 }
5cd82a6d
MF
202 __data_l1_lma = LOADADDR(.data_l1);
203 __data_l1_len = SIZEOF(.data_l1);
204 ASSERT (__data_l1_len <= L1_DATA_A_LENGTH, "L1 data A overflow!")
de6a9520 205
5cd82a6d 206 .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len)
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 }
5cd82a6d
MF
219 __data_b_l1_lma = LOADADDR(.data_b_l1);
220 __data_b_l1_len = SIZEOF(.data_b_l1);
221 ASSERT (__data_b_l1_len <= L1_DATA_B_LENGTH, "L1 data B overflow!")
262c3825 222
5cd82a6d 223 .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len)
262c3825
SZ
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 }
5cd82a6d
MF
245 __l2_lma = LOADADDR(.text_data_l2);
246 __l2_len = SIZEOF(.text_data_l2);
247 ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!")
6f985294 248
36208059
MF
249 /* Force trailing alignment of our init section so that when we
250 * free our init memory, we don't leave behind a partial page.
251 */
d86bfb16 252#ifdef CONFIG_RAMKERNEL
5cd82a6d 253 . = __l2_lma + __l2_len;
d86bfb16
BS
254#else
255 . = __init_data_end;
256#endif
36208059
MF
257 . = ALIGN(PAGE_SIZE);
258 ___init_end = .;
259
b7627acc 260 __end =.;
de6a9520 261
c11b5776
MF
262 STABS_DEBUG
263
264 DWARF_DEBUG
265
023bf6f1 266 DISCARDS
1394f032 267}
This page took 0.524554 seconds and 5 git commands to generate.