blob: 8b67167cb4f4cdeac39c465c0be0a5ba4f52711e [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
2 * File: arch/blackfin/kernel/vmlinux.lds.S
3 * Based on: none - original work
4 * Author:
5 *
6 * Created: Tue Sep 21 2004
7 * Description: Master linker script for blackfin architecture
8 *
9 * Modified:
Mike Frysingerde6a9522007-06-11 17:27:05 +080010 * Copyright 2004-2007 Analog Devices Inc.
Bryan Wu1394f032007-05-06 14:50:22 -070011 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#define VMLINUX_SYMBOL(_sym_) _##_sym_
31
32#include <asm-generic/vmlinux.lds.h>
33#include <asm/mem_map.h>
Mike Frysinger520473b2007-07-12 12:20:20 +080034#include <asm/page.h>
Bernd Schmidt0fa63ad2007-07-25 10:19:59 +080035#include <asm/thread_info.h>
Bryan Wu1394f032007-05-06 14:50:22 -070036
Bryan Wu1394f032007-05-06 14:50:22 -070037OUTPUT_FORMAT("elf32-bfin")
38ENTRY(__start)
39_jiffies = _jiffies_64;
40
Bryan Wu1394f032007-05-06 14:50:22 -070041SECTIONS
42{
43 . = CONFIG_BOOT_LOAD;
Mike Frysingerb7627ac2008-02-02 15:53:17 +080044 /* Neither the text, ro_data or bss section need to be aligned
45 * So pack them back to back
46 */
Bryan Wu1394f032007-05-06 14:50:22 -070047 .text :
48 {
Mike Frysingerde6a9522007-06-11 17:27:05 +080049 __text = .;
50 _text = .;
51 __stext = .;
Sam Ravnborg76647092007-05-13 00:31:33 +020052 TEXT_TEXT
Robin Getzb8d0c772009-03-31 13:40:52 +000053#ifndef CONFIG_SCHEDULE_L1
Bryan Wu1394f032007-05-06 14:50:22 -070054 SCHED_TEXT
Robin Getzb8d0c772009-03-31 13:40:52 +000055#endif
Mike Frysingerde6a9522007-06-11 17:27:05 +080056 LOCK_TEXT
Mike Frysinger27d875f2007-08-27 16:08:53 +080057 KPROBES_TEXT
58 *(.text.*)
Bryan Wu1394f032007-05-06 14:50:22 -070059 *(.fixup)
Bryan Wu1394f032007-05-06 14:50:22 -070060
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +080061#if !L1_CODE_LENGTH
62 *(.l1.text)
63#endif
64
Mike Frysingerde6a9522007-06-11 17:27:05 +080065 . = ALIGN(16);
66 ___start___ex_table = .;
67 *(__ex_table)
68 ___stop___ex_table = .;
69
Bryan Wu1394f032007-05-06 14:50:22 -070070 __etext = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +080071 }
Bryan Wu1394f032007-05-06 14:50:22 -070072
Bernd Schmidt6f985292009-01-07 23:14:39 +080073 NOTES
74
Mike Frysingerb7627ac2008-02-02 15:53:17 +080075 /* Just in case the first read only is a 32-bit access */
76 RO_DATA(4)
77
78 .bss :
79 {
80 . = ALIGN(4);
81 ___bss_start = .;
82 *(.bss .bss.*)
83 *(COMMON)
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +080084#if !L1_DATA_A_LENGTH
85 *(.l1.bss)
86#endif
87#if !L1_DATA_B_LENGTH
88 *(.l1.bss.B)
89#endif
Mike Frysinger13752042008-08-06 17:10:57 +080090 . = ALIGN(4);
Mike Frysingerb7627ac2008-02-02 15:53:17 +080091 ___bss_stop = .;
92 }
Mike Frysingerde6a9522007-06-11 17:27:05 +080093
94 .data :
95 {
96 __sdata = .;
Mike Frysingerb7627ac2008-02-02 15:53:17 +080097 /* This gets done first, so the glob doesn't suck it in */
Mike Frysingerde6a9522007-06-11 17:27:05 +080098 . = ALIGN(32);
99 *(.data.cacheline_aligned)
100
Sonic Zhangb85b82d2008-04-24 06:13:37 +0800101#if !L1_DATA_A_LENGTH
102 . = ALIGN(32);
103 *(.data_l1.cacheline_aligned)
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800104 *(.l1.data)
105#endif
106#if !L1_DATA_B_LENGTH
107 *(.l1.data.B)
Sonic Zhangb85b82d2008-04-24 06:13:37 +0800108#endif
Mike Frysinger07aa7be2008-08-13 16:16:11 +0800109#if !L2_LENGTH
Sonic Zhang262c3822008-07-19 15:42:41 +0800110 . = ALIGN(32);
111 *(.data_l2.cacheline_aligned)
112 *(.l2.data)
113#endif
Sonic Zhangb85b82d2008-04-24 06:13:37 +0800114
Mike Frysinger27d875f2007-08-27 16:08:53 +0800115 DATA_DATA
Mike Frysinger27d875f2007-08-27 16:08:53 +0800116 CONSTRUCTORS
117
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800118 /* make sure the init_task is aligned to the
119 * kernel thread size so we can locate the kernel
120 * stack properly and quickly.
121 */
Bernd Schmidt0fa63ad2007-07-25 10:19:59 +0800122 . = ALIGN(THREAD_SIZE);
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800123 *(.init_task.data)
124
Mike Frysingerde6a9522007-06-11 17:27:05 +0800125 __edata = .;
126 }
127
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800128 /* The init section should be last, so when we free it, it goes into
129 * the general memory pool, and (hopefully) will decrease fragmentation
130 * a tiny bit. The init section has a _requirement_ that it be
131 * PAGE_SIZE aligned
132 */
133 . = ALIGN(PAGE_SIZE);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800134 ___init_begin = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800135
136 .init.text :
Bryan Wu1394f032007-05-06 14:50:22 -0700137 {
Bernd Schmidt0fa63ad2007-07-25 10:19:59 +0800138 . = ALIGN(PAGE_SIZE);
Bryan Wu1394f032007-05-06 14:50:22 -0700139 __sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100140 INIT_TEXT
Bryan Wu1394f032007-05-06 14:50:22 -0700141 __einittext = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800142 }
143 .init.data :
144 {
145 . = ALIGN(16);
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100146 INIT_DATA
Mike Frysinger27d875f2007-08-27 16:08:53 +0800147 }
148 .init.setup :
149 {
Bryan Wu1394f032007-05-06 14:50:22 -0700150 . = ALIGN(16);
151 ___setup_start = .;
152 *(.init.setup)
153 ___setup_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800154 }
155 .initcall.init :
156 {
Bryan Wu1394f032007-05-06 14:50:22 -0700157 ___initcall_start = .;
158 INITCALLS
159 ___initcall_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800160 }
161 .con_initcall.init :
162 {
Bryan Wu1394f032007-05-06 14:50:22 -0700163 ___con_initcall_start = .;
164 *(.con_initcall.init)
165 ___con_initcall_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800166 }
Graf Yang46fa5ee2009-01-07 23:14:39 +0800167 PERCPU(4)
Mike Frysinger27d875f2007-08-27 16:08:53 +0800168 SECURITY_INIT
169 .init.ramfs :
170 {
Bryan Wu1394f032007-05-06 14:50:22 -0700171 . = ALIGN(4);
172 ___initramfs_start = .;
173 *(.init.ramfs)
Bernd Schmidt6f985292009-01-07 23:14:39 +0800174 . = ALIGN(4);
Bryan Wu1394f032007-05-06 14:50:22 -0700175 ___initramfs_end = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800176 }
Bryan Wu1394f032007-05-06 14:50:22 -0700177
Mike Frysingerde6a9522007-06-11 17:27:05 +0800178 __l1_lma_start = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700179
Mike Frysinger27d875f2007-08-27 16:08:53 +0800180 .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
Bryan Wu1394f032007-05-06 14:50:22 -0700181 {
182 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800183 __stext_l1 = .;
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800184 *(.l1.text)
Robin Getzb8d0c772009-03-31 13:40:52 +0000185#ifdef CONFIG_SCHEDULE_L1
186 SCHED_TEXT
187#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700188 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800189 __etext_l1 = .;
190 }
Mike Frysinger4636b302009-03-29 00:47:31 +0800191 ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
Bryan Wu1394f032007-05-06 14:50:22 -0700192
Mike Frysingerde6a9522007-06-11 17:27:05 +0800193 .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
Bryan Wu1394f032007-05-06 14:50:22 -0700194 {
195 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800196 __sdata_l1 = .;
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800197 *(.l1.data)
Mike Frysingerde6a9522007-06-11 17:27:05 +0800198 __edata_l1 = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700199
Bryan Wu1394f032007-05-06 14:50:22 -0700200 . = ALIGN(32);
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800201 *(.data_l1.cacheline_aligned)
Bryan Wu1394f032007-05-06 14:50:22 -0700202
203 . = ALIGN(4);
Sonic Zhang262c3822008-07-19 15:42:41 +0800204 __sbss_l1 = .;
205 *(.l1.bss)
206 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800207 __ebss_l1 = .;
208 }
Mike Frysinger4636b302009-03-29 00:47:31 +0800209 ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
Mike Frysingerde6a9522007-06-11 17:27:05 +0800210
211 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
Bryan Wu1394f032007-05-06 14:50:22 -0700212 {
213 . = ALIGN(4);
214 __sdata_b_l1 = .;
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800215 *(.l1.data.B)
Bryan Wu1394f032007-05-06 14:50:22 -0700216 __edata_b_l1 = .;
217
218 . = ALIGN(4);
219 __sbss_b_l1 = .;
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800220 *(.l1.bss.B)
Bryan Wu1394f032007-05-06 14:50:22 -0700221 . = ALIGN(4);
222 __ebss_b_l1 = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800223 }
Mike Frysinger4636b302009-03-29 00:47:31 +0800224 ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
Bryan Wu1394f032007-05-06 14:50:22 -0700225
Bernd Schmidt6f985292009-01-07 23:14:39 +0800226 __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
Sonic Zhang262c3822008-07-19 15:42:41 +0800227
228 .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
229 {
230 . = ALIGN(4);
231 __stext_l2 = .;
Mike Frysinger07aa7be2008-08-13 16:16:11 +0800232 *(.l2.text)
Sonic Zhang262c3822008-07-19 15:42:41 +0800233 . = ALIGN(4);
234 __etext_l2 = .;
235
236 . = ALIGN(4);
237 __sdata_l2 = .;
Mike Frysinger07aa7be2008-08-13 16:16:11 +0800238 *(.l2.data)
Sonic Zhang262c3822008-07-19 15:42:41 +0800239 __edata_l2 = .;
240
241 . = ALIGN(32);
242 *(.data_l2.cacheline_aligned)
243
244 . = ALIGN(4);
245 __sbss_l2 = .;
Mike Frysinger07aa7be2008-08-13 16:16:11 +0800246 *(.l2.bss)
Sonic Zhang262c3822008-07-19 15:42:41 +0800247 . = ALIGN(4);
248 __ebss_l2 = .;
249 }
Mike Frysinger4636b302009-03-29 00:47:31 +0800250 ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!")
Bernd Schmidt6f985292009-01-07 23:14:39 +0800251
Mike Frysinger36208052007-10-30 12:00:02 +0800252 /* Force trailing alignment of our init section so that when we
253 * free our init memory, we don't leave behind a partial page.
254 */
Bernd Schmidt6f985292009-01-07 23:14:39 +0800255 . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
Mike Frysinger36208052007-10-30 12:00:02 +0800256 . = ALIGN(PAGE_SIZE);
257 ___init_end = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700258
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800259 __end =.;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800260
Mike Frysingerc11b5772007-10-11 00:12:41 +0800261 STABS_DEBUG
262
263 DWARF_DEBUG
264
Mike Frysingerde6a9522007-06-11 17:27:05 +0800265 /DISCARD/ :
266 {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100267 EXIT_TEXT
268 EXIT_DATA
Mike Frysingerde6a9522007-06-11 17:27:05 +0800269 *(.exitcall.exit)
270 }
Bryan Wu1394f032007-05-06 14:50:22 -0700271}