Merge branch 'for-33' of git://repo.or.cz/linux-kbuild
[linux-2.6-block.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{
18 . = CONFIG_BOOT_LOAD;
b7627acc
MF
19 /* Neither the text, ro_data or bss section need to be aligned
20 * So pack them back to back
21 */
1394f032
BW
22 .text :
23 {
de6a9520
MF
24 __text = .;
25 _text = .;
26 __stext = .;
7664709b 27 TEXT_TEXT
b8d0c778 28#ifndef CONFIG_SCHEDULE_L1
1394f032 29 SCHED_TEXT
b8d0c778 30#endif
de6a9520 31 LOCK_TEXT
1ee76d7e 32 IRQENTRY_TEXT
27d875f2
MF
33 KPROBES_TEXT
34 *(.text.*)
de6a9520
MF
35 *(.fixup)
36
bc6e0fa1
MF
37#if !L1_CODE_LENGTH
38 *(.l1.text)
39#endif
40
1394f032 41 . = ALIGN(16);
de6a9520 42 ___start___ex_table = .;
1394f032 43 *(__ex_table)
de6a9520 44 ___stop___ex_table = .;
1394f032 45
1394f032 46 __etext = .;
de6a9520
MF
47 }
48
6f985294
BS
49 NOTES
50
b7627acc
MF
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)
bc6e0fa1
MF
60#if !L1_DATA_A_LENGTH
61 *(.l1.bss)
62#endif
63#if !L1_DATA_B_LENGTH
64 *(.l1.bss.B)
65#endif
13752046 66 . = ALIGN(4);
b7627acc
MF
67 ___bss_stop = .;
68 }
de6a9520
MF
69
70 .data :
71 {
72 __sdata = .;
b7627acc 73 /* This gets done first, so the glob doesn't suck it in */
4a5e3513 74 CACHELINE_ALIGNED_DATA(32)
de6a9520 75
b85b82d9
SZ
76#if !L1_DATA_A_LENGTH
77 . = ALIGN(32);
78 *(.data_l1.cacheline_aligned)
bc6e0fa1
MF
79 *(.l1.data)
80#endif
81#if !L1_DATA_B_LENGTH
82 *(.l1.data.B)
b85b82d9 83#endif
07aa7be5 84#if !L2_LENGTH
262c3825
SZ
85 . = ALIGN(32);
86 *(.data_l2.cacheline_aligned)
87 *(.l2.data)
88#endif
b85b82d9 89
27d875f2 90 DATA_DATA
27d875f2
MF
91 CONSTRUCTORS
92
4a5e3513 93 INIT_TASK_DATA(THREAD_SIZE)
b7627acc 94
de6a9520
MF
95 __edata = .;
96 }
1394f032 97
b7627acc
MF
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);
de6a9520 104 ___init_begin = .;
27d875f2 105
4a5e3513
TA
106 INIT_TEXT_SECTION(PAGE_SIZE)
107 . = ALIGN(16);
108 INIT_DATA_SECTION(16)
46fa5eec 109 PERCPU(4)
70f12567
MF
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
4a5e3513 124 .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
1394f032
BW
125 {
126 . = ALIGN(4);
de6a9520 127 __stext_l1 = .;
bc6e0fa1 128 *(.l1.text)
b8d0c778
RG
129#ifdef CONFIG_SCHEDULE_L1
130 SCHED_TEXT
131#endif
1394f032 132 . = ALIGN(4);
de6a9520
MF
133 __etext_l1 = .;
134 }
5cd82a6d
MF
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!")
1394f032 138
5cd82a6d 139 .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len)
1394f032
BW
140 {
141 . = ALIGN(4);
de6a9520 142 __sdata_l1 = .;
bc6e0fa1 143 *(.l1.data)
de6a9520 144 __edata_l1 = .;
1394f032 145
1394f032 146 . = ALIGN(32);
bc6e0fa1 147 *(.data_l1.cacheline_aligned)
1394f032 148
262c3825
SZ
149 . = ALIGN(4);
150 __sbss_l1 = .;
151 *(.l1.bss)
1394f032 152 . = ALIGN(4);
de6a9520
MF
153 __ebss_l1 = .;
154 }
5cd82a6d
MF
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!")
de6a9520 158
5cd82a6d 159 .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len)
1394f032
BW
160 {
161 . = ALIGN(4);
162 __sdata_b_l1 = .;
bc6e0fa1 163 *(.l1.data.B)
1394f032
BW
164 __edata_b_l1 = .;
165
166 . = ALIGN(4);
167 __sbss_b_l1 = .;
bc6e0fa1 168 *(.l1.bss.B)
1394f032
BW
169 . = ALIGN(4);
170 __ebss_b_l1 = .;
de6a9520 171 }
5cd82a6d
MF
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!")
262c3825 175
5cd82a6d 176 .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len)
262c3825
SZ
177 {
178 . = ALIGN(4);
179 __stext_l2 = .;
07aa7be5 180 *(.l2.text)
262c3825
SZ
181 . = ALIGN(4);
182 __etext_l2 = .;
183
184 . = ALIGN(4);
185 __sdata_l2 = .;
07aa7be5 186 *(.l2.data)
262c3825
SZ
187 __edata_l2 = .;
188
189 . = ALIGN(32);
190 *(.data_l2.cacheline_aligned)
191
192 . = ALIGN(4);
193 __sbss_l2 = .;
07aa7be5 194 *(.l2.bss)
262c3825
SZ
195 . = ALIGN(4);
196 __ebss_l2 = .;
197 }
5cd82a6d
MF
198 __l2_lma = LOADADDR(.text_data_l2);
199 __l2_len = SIZEOF(.text_data_l2);
200 ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!")
6f985294 201
36208059
MF
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 */
5cd82a6d 205 . = __l2_lma + __l2_len;
36208059
MF
206 . = ALIGN(PAGE_SIZE);
207 ___init_end = .;
208
b7627acc 209 __end =.;
de6a9520 210
c11b5776
MF
211 STABS_DEBUG
212
213 DWARF_DEBUG
214
023bf6f1 215 DISCARDS
1394f032 216}