]>
Commit | Line | Data |
---|---|---|
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 |
12 | OUTPUT_FORMAT("elf32-bfin") |
13 | ENTRY(__start) | |
14 | _jiffies = _jiffies_64; | |
15 | ||
1394f032 BW |
16 | SECTIONS |
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 |
6727ad9e | 36 | CPUIDLE_TEXT |
de6a9520 | 37 | LOCK_TEXT |
1ee76d7e | 38 | IRQENTRY_TEXT |
be7635e7 | 39 | SOFTIRQENTRY_TEXT |
27d875f2 | 40 | KPROBES_TEXT |
d86bfb16 BS |
41 | #ifdef CONFIG_ROMKERNEL |
42 | __sinittext = .; | |
43 | INIT_TEXT | |
44 | __einittext = .; | |
45 | EXIT_TEXT | |
46 | #endif | |
27d875f2 | 47 | *(.text.*) |
de6a9520 MF |
48 | *(.fixup) |
49 | ||
bc6e0fa1 MF |
50 | #if !L1_CODE_LENGTH |
51 | *(.l1.text) | |
52 | #endif | |
1394f032 | 53 | __etext = .; |
de6a9520 MF |
54 | } |
55 | ||
d49e8e7e | 56 | EXCEPTION_TABLE(4) |
6f985294 BS |
57 | NOTES |
58 | ||
b7627acc MF |
59 | /* Just in case the first read only is a 32-bit access */ |
60 | RO_DATA(4) | |
d86bfb16 | 61 | __rodata_end = .; |
b7627acc | 62 | |
d86bfb16 BS |
63 | #ifdef CONFIG_ROMKERNEL |
64 | . = CONFIG_BOOT_LOAD; | |
65 | .bss : AT(__rodata_end) | |
66 | #else | |
b7627acc | 67 | .bss : |
d86bfb16 | 68 | #endif |
b7627acc MF |
69 | { |
70 | . = ALIGN(4); | |
71 | ___bss_start = .; | |
72 | *(.bss .bss.*) | |
73 | *(COMMON) | |
bc6e0fa1 MF |
74 | #if !L1_DATA_A_LENGTH |
75 | *(.l1.bss) | |
76 | #endif | |
77 | #if !L1_DATA_B_LENGTH | |
78 | *(.l1.bss.B) | |
79 | #endif | |
13752046 | 80 | . = ALIGN(4); |
b7627acc MF |
81 | ___bss_stop = .; |
82 | } | |
de6a9520 | 83 | |
d86bfb16 BS |
84 | #if defined(CONFIG_ROMKERNEL) |
85 | .data : AT(LOADADDR(.bss) + SIZEOF(.bss)) | |
86 | #else | |
de6a9520 | 87 | .data : |
d86bfb16 | 88 | #endif |
de6a9520 MF |
89 | { |
90 | __sdata = .; | |
b7627acc | 91 | /* This gets done first, so the glob doesn't suck it in */ |
4a5e3513 | 92 | CACHELINE_ALIGNED_DATA(32) |
de6a9520 | 93 | |
b85b82d9 SZ |
94 | #if !L1_DATA_A_LENGTH |
95 | . = ALIGN(32); | |
96 | *(.data_l1.cacheline_aligned) | |
bc6e0fa1 MF |
97 | *(.l1.data) |
98 | #endif | |
99 | #if !L1_DATA_B_LENGTH | |
100 | *(.l1.data.B) | |
b85b82d9 | 101 | #endif |
07aa7be5 | 102 | #if !L2_LENGTH |
262c3825 SZ |
103 | . = ALIGN(32); |
104 | *(.data_l2.cacheline_aligned) | |
105 | *(.l2.data) | |
106 | #endif | |
b85b82d9 | 107 | |
27d875f2 | 108 | DATA_DATA |
27d875f2 MF |
109 | CONSTRUCTORS |
110 | ||
4a5e3513 | 111 | INIT_TASK_DATA(THREAD_SIZE) |
b7627acc | 112 | |
de6a9520 MF |
113 | __edata = .; |
114 | } | |
d86bfb16 BS |
115 | __data_lma = LOADADDR(.data); |
116 | __data_len = SIZEOF(.data); | |
1394f032 | 117 | |
b7627acc MF |
118 | /* The init section should be last, so when we free it, it goes into |
119 | * the general memory pool, and (hopefully) will decrease fragmentation | |
120 | * a tiny bit. The init section has a _requirement_ that it be | |
121 | * PAGE_SIZE aligned | |
122 | */ | |
123 | . = ALIGN(PAGE_SIZE); | |
de6a9520 | 124 | ___init_begin = .; |
27d875f2 | 125 | |
d86bfb16 | 126 | #ifdef CONFIG_RAMKERNEL |
4a5e3513 | 127 | INIT_TEXT_SECTION(PAGE_SIZE) |
70f12567 | 128 | |
0afc272c | 129 | /* We have to discard exit text and such at runtime, not link time, to |
70f12567 | 130 | * handle embedded cross-section references (alt instructions, bug |
0afc272c JZ |
131 | * table, eh_frame, etc...). We need all of our .text up front and |
132 | * .data after it for PCREL call issues. | |
70f12567 MF |
133 | */ |
134 | .exit.text : | |
135 | { | |
136 | EXIT_TEXT | |
137 | } | |
0afc272c JZ |
138 | |
139 | . = ALIGN(16); | |
140 | INIT_DATA_SECTION(16) | |
0415b00d | 141 | PERCPU_SECTION(32) |
0afc272c | 142 | |
70f12567 MF |
143 | .exit.data : |
144 | { | |
145 | EXIT_DATA | |
146 | } | |
147 | ||
4a5e3513 | 148 | .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data)) |
d86bfb16 | 149 | #else |
b76f9823 | 150 | .init.data : AT(__data_lma + __data_len + 32) |
d86bfb16 BS |
151 | { |
152 | __sinitdata = .; | |
153 | INIT_DATA | |
154 | INIT_SETUP(16) | |
155 | INIT_CALLS | |
156 | CON_INITCALL | |
157 | SECURITY_INITCALL | |
158 | INIT_RAM_FS | |
159 | ||
353470cc | 160 | . = ALIGN(PAGE_SIZE); |
d86bfb16 | 161 | ___per_cpu_load = .; |
d6cb2e3a | 162 | PERCPU_INPUT(32) |
d86bfb16 BS |
163 | |
164 | EXIT_DATA | |
165 | __einitdata = .; | |
166 | } | |
167 | __init_data_lma = LOADADDR(.init.data); | |
168 | __init_data_len = SIZEOF(.init.data); | |
169 | __init_data_end = .; | |
170 | ||
171 | .text_l1 L1_CODE_START : AT(__init_data_lma + __init_data_len) | |
172 | #endif | |
1394f032 BW |
173 | { |
174 | . = ALIGN(4); | |
de6a9520 | 175 | __stext_l1 = .; |
c6345ab1 | 176 | *(.l1.text.head) |
bc6e0fa1 | 177 | *(.l1.text) |
b8d0c778 RG |
178 | #ifdef CONFIG_SCHEDULE_L1 |
179 | SCHED_TEXT | |
180 | #endif | |
1394f032 | 181 | . = ALIGN(4); |
de6a9520 MF |
182 | __etext_l1 = .; |
183 | } | |
5cd82a6d MF |
184 | __text_l1_lma = LOADADDR(.text_l1); |
185 | __text_l1_len = SIZEOF(.text_l1); | |
186 | ASSERT (__text_l1_len <= L1_CODE_LENGTH, "L1 text overflow!") | |
1394f032 | 187 | |
5cd82a6d | 188 | .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len) |
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 | } | |
5cd82a6d MF |
204 | __data_l1_lma = LOADADDR(.data_l1); |
205 | __data_l1_len = SIZEOF(.data_l1); | |
206 | ASSERT (__data_l1_len <= L1_DATA_A_LENGTH, "L1 data A overflow!") | |
de6a9520 | 207 | |
5cd82a6d | 208 | .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len) |
1394f032 BW |
209 | { |
210 | . = ALIGN(4); | |
211 | __sdata_b_l1 = .; | |
bc6e0fa1 | 212 | *(.l1.data.B) |
1394f032 BW |
213 | __edata_b_l1 = .; |
214 | ||
215 | . = ALIGN(4); | |
216 | __sbss_b_l1 = .; | |
bc6e0fa1 | 217 | *(.l1.bss.B) |
1394f032 BW |
218 | . = ALIGN(4); |
219 | __ebss_b_l1 = .; | |
de6a9520 | 220 | } |
5cd82a6d MF |
221 | __data_b_l1_lma = LOADADDR(.data_b_l1); |
222 | __data_b_l1_len = SIZEOF(.data_b_l1); | |
223 | ASSERT (__data_b_l1_len <= L1_DATA_B_LENGTH, "L1 data B overflow!") | |
262c3825 | 224 | |
5cd82a6d | 225 | .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len) |
262c3825 SZ |
226 | { |
227 | . = ALIGN(4); | |
228 | __stext_l2 = .; | |
07aa7be5 | 229 | *(.l2.text) |
262c3825 SZ |
230 | . = ALIGN(4); |
231 | __etext_l2 = .; | |
232 | ||
233 | . = ALIGN(4); | |
234 | __sdata_l2 = .; | |
07aa7be5 | 235 | *(.l2.data) |
262c3825 SZ |
236 | __edata_l2 = .; |
237 | ||
238 | . = ALIGN(32); | |
239 | *(.data_l2.cacheline_aligned) | |
240 | ||
241 | . = ALIGN(4); | |
242 | __sbss_l2 = .; | |
07aa7be5 | 243 | *(.l2.bss) |
262c3825 SZ |
244 | . = ALIGN(4); |
245 | __ebss_l2 = .; | |
246 | } | |
5cd82a6d MF |
247 | __l2_lma = LOADADDR(.text_data_l2); |
248 | __l2_len = SIZEOF(.text_data_l2); | |
249 | ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!") | |
6f985294 | 250 | |
36208059 MF |
251 | /* Force trailing alignment of our init section so that when we |
252 | * free our init memory, we don't leave behind a partial page. | |
253 | */ | |
d86bfb16 | 254 | #ifdef CONFIG_RAMKERNEL |
5cd82a6d | 255 | . = __l2_lma + __l2_len; |
d86bfb16 BS |
256 | #else |
257 | . = __init_data_end; | |
258 | #endif | |
36208059 MF |
259 | . = ALIGN(PAGE_SIZE); |
260 | ___init_end = .; | |
261 | ||
b7627acc | 262 | __end =.; |
de6a9520 | 263 | |
c11b5776 MF |
264 | STABS_DEBUG |
265 | ||
266 | DWARF_DEBUG | |
267 | ||
023bf6f1 | 268 | DISCARDS |
1394f032 | 269 | } |