Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / arch / blackfin / kernel / vmlinux.lds.S
1 /*
2  * Copyright 2004-2009 Analog Devices Inc.
3  *
4  * Licensed under the GPL-2 or later
5  */
6
7 #include <asm-generic/vmlinux.lds.h>
8 #include <asm/mem_map.h>
9 #include <asm/page.h>
10 #include <asm/thread_info.h>
11
12 OUTPUT_FORMAT("elf32-bfin")
13 ENTRY(__start)
14 _jiffies = _jiffies_64;
15
16 SECTIONS
17 {
18 #ifdef CONFIG_RAMKERNEL
19         . = CONFIG_BOOT_LOAD;
20 #else
21         . = CONFIG_ROM_BASE;
22 #endif
23
24         /* Neither the text, ro_data or bss section need to be aligned
25          * So pack them back to back
26          */
27         .text :
28         {
29                 __text = .;
30                 _text = .;
31                 __stext = .;
32                 TEXT_TEXT
33 #ifndef CONFIG_SCHEDULE_L1
34                 SCHED_TEXT
35 #endif
36                 LOCK_TEXT
37                 IRQENTRY_TEXT
38                 KPROBES_TEXT
39 #ifdef CONFIG_ROMKERNEL
40                 __sinittext = .;
41                 INIT_TEXT
42                 __einittext = .;
43                 EXIT_TEXT
44 #endif
45                 *(.text.*)
46                 *(.fixup)
47
48 #if !L1_CODE_LENGTH
49                 *(.l1.text)
50 #endif
51
52                 . = ALIGN(16);
53                 ___start___ex_table = .;
54                 *(__ex_table)
55                 ___stop___ex_table = .;
56
57                 __etext = .;
58         }
59
60         NOTES
61
62         /* Just in case the first read only is a 32-bit access */
63         RO_DATA(4)
64         __rodata_end = .;
65
66 #ifdef CONFIG_ROMKERNEL
67         . = CONFIG_BOOT_LOAD;
68         .bss : AT(__rodata_end)
69 #else
70         .bss :
71 #endif
72         {
73                 . = ALIGN(4);
74                 ___bss_start = .;
75                 *(.bss .bss.*)
76                 *(COMMON)
77 #if !L1_DATA_A_LENGTH
78                 *(.l1.bss)
79 #endif
80 #if !L1_DATA_B_LENGTH
81                 *(.l1.bss.B)
82 #endif
83                 . = ALIGN(4);
84                 ___bss_stop = .;
85         }
86
87 #if defined(CONFIG_ROMKERNEL)
88         .data : AT(LOADADDR(.bss) + SIZEOF(.bss))
89 #else
90         .data :
91 #endif
92         {
93                 __sdata = .;
94                 /* This gets done first, so the glob doesn't suck it in */
95                 CACHELINE_ALIGNED_DATA(32)
96
97 #if !L1_DATA_A_LENGTH
98                 . = ALIGN(32);
99                 *(.data_l1.cacheline_aligned)
100                 *(.l1.data)
101 #endif
102 #if !L1_DATA_B_LENGTH
103                 *(.l1.data.B)
104 #endif
105 #if !L2_LENGTH
106                 . = ALIGN(32);
107                 *(.data_l2.cacheline_aligned)
108                 *(.l2.data)
109 #endif
110
111                 DATA_DATA
112                 CONSTRUCTORS
113
114                 INIT_TASK_DATA(THREAD_SIZE)
115
116                 __edata = .;
117         }
118         __data_lma = LOADADDR(.data);
119         __data_len = SIZEOF(.data);
120
121         /* The init section should be last, so when we free it, it goes into
122          * the general memory pool, and (hopefully) will decrease fragmentation
123          * a tiny bit. The init section has a _requirement_ that it be
124          * PAGE_SIZE aligned
125          */
126         . = ALIGN(PAGE_SIZE);
127         ___init_begin = .;
128
129 #ifdef CONFIG_RAMKERNEL
130         INIT_TEXT_SECTION(PAGE_SIZE)
131
132         /* We have to discard exit text and such at runtime, not link time, to
133          * handle embedded cross-section references (alt instructions, bug
134          * table, eh_frame, etc...).  We need all of our .text up front and
135          * .data after it for PCREL call issues.
136          */
137         .exit.text :
138         {
139                 EXIT_TEXT
140         }
141
142         . = ALIGN(16);
143         INIT_DATA_SECTION(16)
144         PERCPU(4)
145
146         .exit.data :
147         {
148                 EXIT_DATA
149         }
150
151         .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
152 #else
153         .init.data : AT(__data_lma + __data_len)
154         {
155                 __sinitdata = .;
156                 INIT_DATA
157                 INIT_SETUP(16)
158                 INIT_CALLS
159                 CON_INITCALL
160                 SECURITY_INITCALL
161                 INIT_RAM_FS
162
163                 . = ALIGN(4);
164                 ___per_cpu_load = .;
165                 ___per_cpu_start = .;
166                 *(.data.percpu.first)
167                 *(.data.percpu.page_aligned)
168                 *(.data.percpu)
169                 *(.data.percpu.shared_aligned)
170                 ___per_cpu_end = .;
171
172                 EXIT_DATA
173                 __einitdata = .;
174         }
175         __init_data_lma = LOADADDR(.init.data);
176         __init_data_len = SIZEOF(.init.data);
177         __init_data_end = .;
178
179         .text_l1 L1_CODE_START : AT(__init_data_lma + __init_data_len)
180 #endif
181         {
182                 . = ALIGN(4);
183                 __stext_l1 = .;
184                 *(.l1.text)
185 #ifdef CONFIG_SCHEDULE_L1
186                 SCHED_TEXT
187 #endif
188                 . = ALIGN(4);
189                 __etext_l1 = .;
190         }
191         __text_l1_lma = LOADADDR(.text_l1);
192         __text_l1_len = SIZEOF(.text_l1);
193         ASSERT (__text_l1_len <= L1_CODE_LENGTH, "L1 text overflow!")
194
195         .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len)
196         {
197                 . = ALIGN(4);
198                 __sdata_l1 = .;
199                 *(.l1.data)
200                 __edata_l1 = .;
201
202                 . = ALIGN(32);
203                 *(.data_l1.cacheline_aligned)
204
205                 . = ALIGN(4);
206                 __sbss_l1 = .;
207                 *(.l1.bss)
208                 . = ALIGN(4);
209                 __ebss_l1 = .;
210         }
211         __data_l1_lma = LOADADDR(.data_l1);
212         __data_l1_len = SIZEOF(.data_l1);
213         ASSERT (__data_l1_len <= L1_DATA_A_LENGTH, "L1 data A overflow!")
214
215         .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len)
216         {
217                 . = ALIGN(4);
218                 __sdata_b_l1 = .;
219                 *(.l1.data.B)
220                 __edata_b_l1 = .;
221
222                 . = ALIGN(4);
223                 __sbss_b_l1 = .;
224                 *(.l1.bss.B)
225                 . = ALIGN(4);
226                 __ebss_b_l1 = .;
227         }
228         __data_b_l1_lma = LOADADDR(.data_b_l1);
229         __data_b_l1_len = SIZEOF(.data_b_l1);
230         ASSERT (__data_b_l1_len <= L1_DATA_B_LENGTH, "L1 data B overflow!")
231
232         .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len)
233         {
234                 . = ALIGN(4);
235                 __stext_l2 = .;
236                 *(.l2.text)
237                 . = ALIGN(4);
238                 __etext_l2 = .;
239
240                 . = ALIGN(4);
241                 __sdata_l2 = .;
242                 *(.l2.data)
243                 __edata_l2 = .;
244
245                 . = ALIGN(32);
246                 *(.data_l2.cacheline_aligned)
247
248                 . = ALIGN(4);
249                 __sbss_l2 = .;
250                 *(.l2.bss)
251                 . = ALIGN(4);
252                 __ebss_l2 = .;
253         }
254         __l2_lma = LOADADDR(.text_data_l2);
255         __l2_len = SIZEOF(.text_data_l2);
256         ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!")
257
258         /* Force trailing alignment of our init section so that when we
259          * free our init memory, we don't leave behind a partial page.
260          */
261 #ifdef CONFIG_RAMKERNEL
262         . = __l2_lma + __l2_len;
263 #else
264         . = __init_data_end;
265 #endif
266         . = ALIGN(PAGE_SIZE);
267         ___init_end = .;
268
269         __end =.;
270
271         STABS_DEBUG
272
273         DWARF_DEBUG
274
275         DISCARDS
276 }