module: make MODULE_SYMBOL_PREFIX into a CONFIG option
[safe/jmp/linux-2.6] / 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         __l1_lma_start = .;
125
126         .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
127         {
128                 . = ALIGN(4);
129                 __stext_l1 = .;
130                 *(.l1.text)
131 #ifdef CONFIG_SCHEDULE_L1
132                 SCHED_TEXT
133 #endif
134                 . = ALIGN(4);
135                 __etext_l1 = .;
136         }
137         ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
138
139         .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
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         ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
156
157         .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
158         {
159                 . = ALIGN(4);
160                 __sdata_b_l1 = .;
161                 *(.l1.data.B)
162                 __edata_b_l1 = .;
163
164                 . = ALIGN(4);
165                 __sbss_b_l1 = .;
166                 *(.l1.bss.B)
167                 . = ALIGN(4);
168                 __ebss_b_l1 = .;
169         }
170         ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
171
172         __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
173
174         .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
175         {
176                 . = ALIGN(4);
177                 __stext_l2 = .;
178                 *(.l2.text)
179                 . = ALIGN(4);
180                 __etext_l2 = .;
181
182                 . = ALIGN(4);
183                 __sdata_l2 = .;
184                 *(.l2.data)
185                 __edata_l2 = .;
186
187                 . = ALIGN(32);
188                 *(.data_l2.cacheline_aligned)
189
190                 . = ALIGN(4);
191                 __sbss_l2 = .;
192                 *(.l2.bss)
193                 . = ALIGN(4);
194                 __ebss_l2 = .;
195         }
196         ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!")
197
198         /* Force trailing alignment of our init section so that when we
199          * free our init memory, we don't leave behind a partial page.
200          */
201         . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
202         . = ALIGN(PAGE_SIZE);
203         ___init_end = .;
204
205         __end =.;
206
207         STABS_DEBUG
208
209         DWARF_DEBUG
210
211         DISCARDS
212 }