blob: 0896e38d61087f1398a096cb6790d96afc4febc6 [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
Bryan Wu1394f032007-05-06 14:50:22 -070053 SCHED_TEXT
Mike Frysingerde6a9522007-06-11 17:27:05 +080054 LOCK_TEXT
Mike Frysinger27d875f2007-08-27 16:08:53 +080055 KPROBES_TEXT
56 *(.text.*)
Bryan Wu1394f032007-05-06 14:50:22 -070057 *(.fixup)
Bryan Wu1394f032007-05-06 14:50:22 -070058
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +080059#if !L1_CODE_LENGTH
60 *(.l1.text)
61#endif
62
Mike Frysingerde6a9522007-06-11 17:27:05 +080063 . = ALIGN(16);
64 ___start___ex_table = .;
65 *(__ex_table)
66 ___stop___ex_table = .;
67
Bryan Wu1394f032007-05-06 14:50:22 -070068 __etext = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +080069 }
Bryan Wu1394f032007-05-06 14:50:22 -070070
Mike Frysingerb7627ac2008-02-02 15:53:17 +080071 /* Just in case the first read only is a 32-bit access */
72 RO_DATA(4)
73
74 .bss :
75 {
76 . = ALIGN(4);
77 ___bss_start = .;
78 *(.bss .bss.*)
79 *(COMMON)
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +080080#if !L1_DATA_A_LENGTH
81 *(.l1.bss)
82#endif
83#if !L1_DATA_B_LENGTH
84 *(.l1.bss.B)
85#endif
Mike Frysingerb7627ac2008-02-02 15:53:17 +080086 ___bss_stop = .;
87 }
Mike Frysingerde6a9522007-06-11 17:27:05 +080088
89 .data :
90 {
91 __sdata = .;
Mike Frysingerb7627ac2008-02-02 15:53:17 +080092 /* This gets done first, so the glob doesn't suck it in */
Mike Frysingerde6a9522007-06-11 17:27:05 +080093 . = ALIGN(32);
94 *(.data.cacheline_aligned)
95
Sonic Zhangb85b82d2008-04-24 06:13:37 +080096#if !L1_DATA_A_LENGTH
97 . = ALIGN(32);
98 *(.data_l1.cacheline_aligned)
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +080099 *(.l1.data)
100#endif
101#if !L1_DATA_B_LENGTH
102 *(.l1.data.B)
Sonic Zhangb85b82d2008-04-24 06:13:37 +0800103#endif
Sonic Zhang262c3822008-07-19 15:42:41 +0800104#ifndef L2_LENGTH
105 . = ALIGN(32);
106 *(.data_l2.cacheline_aligned)
107 *(.l2.data)
108#endif
Sonic Zhangb85b82d2008-04-24 06:13:37 +0800109
Mike Frysinger27d875f2007-08-27 16:08:53 +0800110 DATA_DATA
111 *(.data.*)
112 CONSTRUCTORS
113
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800114 /* make sure the init_task is aligned to the
115 * kernel thread size so we can locate the kernel
116 * stack properly and quickly.
117 */
Bernd Schmidt0fa63ad2007-07-25 10:19:59 +0800118 . = ALIGN(THREAD_SIZE);
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800119 *(.init_task.data)
120
Mike Frysingerde6a9522007-06-11 17:27:05 +0800121 __edata = .;
122 }
123
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800124 /* The init section should be last, so when we free it, it goes into
125 * the general memory pool, and (hopefully) will decrease fragmentation
126 * a tiny bit. The init section has a _requirement_ that it be
127 * PAGE_SIZE aligned
128 */
129 . = ALIGN(PAGE_SIZE);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800130 ___init_begin = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800131
132 .init.text :
Bryan Wu1394f032007-05-06 14:50:22 -0700133 {
Bernd Schmidt0fa63ad2007-07-25 10:19:59 +0800134 . = ALIGN(PAGE_SIZE);
Bryan Wu1394f032007-05-06 14:50:22 -0700135 __sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100136 INIT_TEXT
Bryan Wu1394f032007-05-06 14:50:22 -0700137 __einittext = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800138 }
139 .init.data :
140 {
141 . = ALIGN(16);
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100142 INIT_DATA
Mike Frysinger27d875f2007-08-27 16:08:53 +0800143 }
144 .init.setup :
145 {
Bryan Wu1394f032007-05-06 14:50:22 -0700146 . = ALIGN(16);
147 ___setup_start = .;
148 *(.init.setup)
149 ___setup_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800150 }
151 .initcall.init :
152 {
Bryan Wu1394f032007-05-06 14:50:22 -0700153 ___initcall_start = .;
154 INITCALLS
155 ___initcall_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800156 }
157 .con_initcall.init :
158 {
Bryan Wu1394f032007-05-06 14:50:22 -0700159 ___con_initcall_start = .;
160 *(.con_initcall.init)
161 ___con_initcall_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800162 }
163 SECURITY_INIT
164 .init.ramfs :
165 {
Bryan Wu1394f032007-05-06 14:50:22 -0700166 . = ALIGN(4);
167 ___initramfs_start = .;
168 *(.init.ramfs)
169 ___initramfs_end = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800170 }
Bryan Wu1394f032007-05-06 14:50:22 -0700171
Mike Frysingerde6a9522007-06-11 17:27:05 +0800172 __l1_lma_start = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700173
Mike Frysinger27d875f2007-08-27 16:08:53 +0800174 .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
Bryan Wu1394f032007-05-06 14:50:22 -0700175 {
176 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800177 __stext_l1 = .;
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800178 *(.l1.text)
Bryan Wu1394f032007-05-06 14:50:22 -0700179 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800180 __etext_l1 = .;
181 }
Bryan Wu1394f032007-05-06 14:50:22 -0700182
Mike Frysingerde6a9522007-06-11 17:27:05 +0800183 .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
Bryan Wu1394f032007-05-06 14:50:22 -0700184 {
185 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800186 __sdata_l1 = .;
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800187 *(.l1.data)
Mike Frysingerde6a9522007-06-11 17:27:05 +0800188 __edata_l1 = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700189
Bryan Wu1394f032007-05-06 14:50:22 -0700190 . = ALIGN(32);
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800191 *(.data_l1.cacheline_aligned)
Bryan Wu1394f032007-05-06 14:50:22 -0700192
193 . = ALIGN(4);
Sonic Zhang262c3822008-07-19 15:42:41 +0800194 __sbss_l1 = .;
195 *(.l1.bss)
196 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800197 __ebss_l1 = .;
198 }
199
200 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
Bryan Wu1394f032007-05-06 14:50:22 -0700201 {
202 . = ALIGN(4);
203 __sdata_b_l1 = .;
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800204 *(.l1.data.B)
Bryan Wu1394f032007-05-06 14:50:22 -0700205 __edata_b_l1 = .;
206
207 . = ALIGN(4);
208 __sbss_b_l1 = .;
Mike Frysingerbc6e0fa2008-04-24 06:21:25 +0800209 *(.l1.bss.B)
Bryan Wu1394f032007-05-06 14:50:22 -0700210 . = ALIGN(4);
211 __ebss_b_l1 = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800212 }
Bryan Wu1394f032007-05-06 14:50:22 -0700213
Sonic Zhang262c3822008-07-19 15:42:41 +0800214#ifdef L2_LENGTH
215 __l2_lma_start = .;
216
217 .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
218 {
219 . = ALIGN(4);
220 __stext_l2 = .;
221 *(.l1.text)
222 . = ALIGN(4);
223 __etext_l2 = .;
224
225 . = ALIGN(4);
226 __sdata_l2 = .;
227 *(.l1.data)
228 __edata_l2 = .;
229
230 . = ALIGN(32);
231 *(.data_l2.cacheline_aligned)
232
233 . = ALIGN(4);
234 __sbss_l2 = .;
235 *(.l1.bss)
236 . = ALIGN(4);
237 __ebss_l2 = .;
238 }
239#endif
240
Mike Frysinger36208052007-10-30 12:00:02 +0800241 /* Force trailing alignment of our init section so that when we
242 * free our init memory, we don't leave behind a partial page.
243 */
244 . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
245 . = ALIGN(PAGE_SIZE);
246 ___init_end = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700247
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800248 __end =.;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800249
Mike Frysingerc11b5772007-10-11 00:12:41 +0800250 STABS_DEBUG
251
252 DWARF_DEBUG
253
Mike Frysingerde6a9522007-06-11 17:27:05 +0800254 /DISCARD/ :
255 {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100256 EXIT_TEXT
257 EXIT_DATA
Mike Frysingerde6a9522007-06-11 17:27:05 +0800258 *(.exitcall.exit)
259 }
Bryan Wu1394f032007-05-06 14:50:22 -0700260}