Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[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         . = CONFIG_BOOT_LOAD;
19         /* Neither the text, ro_data or bss section need to be aligned
20          * So pack them back to back
21          */
22         .text :
23         {
24                 __text = .;
25                 _text = .;
26                 __stext = .;
27                 TEXT_TEXT
28 #ifndef CONFIG_SCHEDULE_L1
29                 SCHED_TEXT
30 #endif
31                 LOCK_TEXT
32                 IRQENTRY_TEXT
33                 KPROBES_TEXT
34                 *(.text.*)
35                 *(.fixup)
36
37 #if !L1_CODE_LENGTH
38                 *(.l1.text)
39 #endif
40
41                 . = ALIGN(16);
42                 ___start___ex_table = .;
43                 *(__ex_table)
44                 ___stop___ex_table = .;
45
46                 __etext = .;
47         }
48
49         NOTES
50
51         /* Just in case the first read only is a 32-bit access */
52         RO_DATA(4)
53
54         .bss :
55         {
56                 . = ALIGN(4);
57                 ___bss_start = .;
58                 *(.bss .bss.*)
59                 *(COMMON)
60 #if !L1_DATA_A_LENGTH
61                 *(.l1.bss)
62 #endif
63 #if !L1_DATA_B_LENGTH
64                 *(.l1.bss.B)
65 #endif
66                 . = ALIGN(4);
67                 ___bss_stop = .;
68         }
69
70         .data :
71         {
72                 __sdata = .;
73                 /* This gets done first, so the glob doesn't suck it in */
74                 CACHELINE_ALIGNED_DATA(32)
75
76 #if !L1_DATA_A_LENGTH
77                 . = ALIGN(32);
78                 *(.data_l1.cacheline_aligned)
79                 *(.l1.data)
80 #endif
81 #if !L1_DATA_B_LENGTH
82                 *(.l1.data.B)
83 #endif
84 #if !L2_LENGTH
85                 . = ALIGN(32);
86                 *(.data_l2.cacheline_aligned)
87                 *(.l2.data)
88 #endif
89
90                 DATA_DATA
91                 CONSTRUCTORS
92
93                 INIT_TASK_DATA(THREAD_SIZE)
94
95                 __edata = .;
96         }
97
98         /* The init section should be last, so when we free it, it goes into
99          * the general memory pool, and (hopefully) will decrease fragmentation
100          * a tiny bit. The init section has a _requirement_ that it be
101          * PAGE_SIZE aligned
102          */
103         . = ALIGN(PAGE_SIZE);
104         ___init_begin = .;
105
106         INIT_TEXT_SECTION(PAGE_SIZE)
107         . = ALIGN(16);
108         INIT_DATA_SECTION(16)
109         PERCPU(4)
110
111         /* we have to discard exit text and such at runtime, not link time, to
112          * handle embedded cross-section references (alt instructions, bug
113          * table, eh_frame, etc...)
114          */
115         .exit.text :
116         {
117                 EXIT_TEXT
118         }
119         .exit.data :
120         {
121                 EXIT_DATA
122         }
123
124         .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
125         {
126                 . = ALIGN(4);
127                 __stext_l1 = .;
128                 *(.l1.text)
129 #ifdef CONFIG_SCHEDULE_L1
130                 SCHED_TEXT
131 #endif
132                 . = ALIGN(4);
133                 __etext_l1 = .;
134         }
135         __text_l1_lma = LOADADDR(.text_l1);
136         __text_l1_len = SIZEOF(.text_l1);
137         ASSERT (__text_l1_len <= L1_CODE_LENGTH, "L1 text overflow!")
138
139         .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len)
140         {
141                 . = ALIGN(4);
142                 __sdata_l1 = .;
143                 *(.l1.data)
144                 __edata_l1 = .;
145
146                 . = ALIGN(32);
147                 *(.data_l1.cacheline_aligned)
148
149                 . = ALIGN(4);
150                 __sbss_l1 = .;
151                 *(.l1.bss)
152                 . = ALIGN(4);
153                 __ebss_l1 = .;
154         }
155         __data_l1_lma = LOADADDR(.data_l1);
156         __data_l1_len = SIZEOF(.data_l1);
157         ASSERT (__data_l1_len <= L1_DATA_A_LENGTH, "L1 data A overflow!")
158
159         .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len)
160         {
161                 . = ALIGN(4);
162                 __sdata_b_l1 = .;
163                 *(.l1.data.B)
164                 __edata_b_l1 = .;
165
166                 . = ALIGN(4);
167                 __sbss_b_l1 = .;
168                 *(.l1.bss.B)
169                 . = ALIGN(4);
170                 __ebss_b_l1 = .;
171         }
172         __data_b_l1_lma = LOADADDR(.data_b_l1);
173         __data_b_l1_len = SIZEOF(.data_b_l1);
174         ASSERT (__data_b_l1_len <= L1_DATA_B_LENGTH, "L1 data B overflow!")
175
176         .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len)
177         {
178                 . = ALIGN(4);
179                 __stext_l2 = .;
180                 *(.l2.text)
181                 . = ALIGN(4);
182                 __etext_l2 = .;
183
184                 . = ALIGN(4);
185                 __sdata_l2 = .;
186                 *(.l2.data)
187                 __edata_l2 = .;
188
189                 . = ALIGN(32);
190                 *(.data_l2.cacheline_aligned)
191
192                 . = ALIGN(4);
193                 __sbss_l2 = .;
194                 *(.l2.bss)
195                 . = ALIGN(4);
196                 __ebss_l2 = .;
197         }
198         __l2_lma = LOADADDR(.text_data_l2);
199         __l2_len = SIZEOF(.text_data_l2);
200         ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!")
201
202         /* Force trailing alignment of our init section so that when we
203          * free our init memory, we don't leave behind a partial page.
204          */
205         . = __l2_lma + __l2_len;
206         . = ALIGN(PAGE_SIZE);
207         ___init_end = .;
208
209         __end =.;
210
211         STABS_DEBUG
212
213         DWARF_DEBUG
214
215         DISCARDS
216 }