blob: cb01a9de26802aad098eef036a434cdaf8d6b0d7 [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 Frysingerde6a9522007-06-11 17:27:05 +080059 . = ALIGN(16);
60 ___start___ex_table = .;
61 *(__ex_table)
62 ___stop___ex_table = .;
63
Bryan Wu1394f032007-05-06 14:50:22 -070064 __etext = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +080065 }
Bryan Wu1394f032007-05-06 14:50:22 -070066
Mike Frysingerb7627ac2008-02-02 15:53:17 +080067 /* Just in case the first read only is a 32-bit access */
68 RO_DATA(4)
69
70 .bss :
71 {
72 . = ALIGN(4);
73 ___bss_start = .;
74 *(.bss .bss.*)
75 *(COMMON)
76 ___bss_stop = .;
77 }
Mike Frysingerde6a9522007-06-11 17:27:05 +080078
79 .data :
80 {
81 __sdata = .;
Mike Frysingerb7627ac2008-02-02 15:53:17 +080082 /* This gets done first, so the glob doesn't suck it in */
Mike Frysingerde6a9522007-06-11 17:27:05 +080083 . = ALIGN(32);
84 *(.data.cacheline_aligned)
85
Mike Frysinger27d875f2007-08-27 16:08:53 +080086 DATA_DATA
87 *(.data.*)
88 CONSTRUCTORS
89
Mike Frysingerb7627ac2008-02-02 15:53:17 +080090 /* make sure the init_task is aligned to the
91 * kernel thread size so we can locate the kernel
92 * stack properly and quickly.
93 */
Bernd Schmidt0fa63ad2007-07-25 10:19:59 +080094 . = ALIGN(THREAD_SIZE);
Mike Frysingerb7627ac2008-02-02 15:53:17 +080095 *(.init_task.data)
96
Mike Frysingerde6a9522007-06-11 17:27:05 +080097 __edata = .;
98 }
99
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800100 /* The init section should be last, so when we free it, it goes into
101 * the general memory pool, and (hopefully) will decrease fragmentation
102 * a tiny bit. The init section has a _requirement_ that it be
103 * PAGE_SIZE aligned
104 */
105 . = ALIGN(PAGE_SIZE);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800106 ___init_begin = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800107
108 .init.text :
Bryan Wu1394f032007-05-06 14:50:22 -0700109 {
Bernd Schmidt0fa63ad2007-07-25 10:19:59 +0800110 . = ALIGN(PAGE_SIZE);
Bryan Wu1394f032007-05-06 14:50:22 -0700111 __sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100112 INIT_TEXT
Bryan Wu1394f032007-05-06 14:50:22 -0700113 __einittext = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800114 }
115 .init.data :
116 {
117 . = ALIGN(16);
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100118 INIT_DATA
Mike Frysinger27d875f2007-08-27 16:08:53 +0800119 }
120 .init.setup :
121 {
Bryan Wu1394f032007-05-06 14:50:22 -0700122 . = ALIGN(16);
123 ___setup_start = .;
124 *(.init.setup)
125 ___setup_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800126 }
127 .initcall.init :
128 {
Bryan Wu1394f032007-05-06 14:50:22 -0700129 ___initcall_start = .;
130 INITCALLS
131 ___initcall_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800132 }
133 .con_initcall.init :
134 {
Bryan Wu1394f032007-05-06 14:50:22 -0700135 ___con_initcall_start = .;
136 *(.con_initcall.init)
137 ___con_initcall_end = .;
Mike Frysinger27d875f2007-08-27 16:08:53 +0800138 }
139 SECURITY_INIT
140 .init.ramfs :
141 {
Bryan Wu1394f032007-05-06 14:50:22 -0700142 . = ALIGN(4);
143 ___initramfs_start = .;
144 *(.init.ramfs)
145 ___initramfs_end = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800146 }
Bryan Wu1394f032007-05-06 14:50:22 -0700147
Mike Frysingerde6a9522007-06-11 17:27:05 +0800148 __l1_lma_start = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700149
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800150#if L1_CODE_LENGTH
151# define LDS_L1_CODE *(.l1.text)
152#else
153# define LDS_L1_CODE
154#endif
Mike Frysinger27d875f2007-08-27 16:08:53 +0800155 .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
Bryan Wu1394f032007-05-06 14:50:22 -0700156 {
157 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800158 __stext_l1 = .;
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800159 LDS_L1_CODE
Bryan Wu1394f032007-05-06 14:50:22 -0700160 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800161 __etext_l1 = .;
162 }
Bryan Wu1394f032007-05-06 14:50:22 -0700163
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800164#if L1_DATA_A_LENGTH
165# define LDS_L1_A_DATA *(.l1.data)
166# define LDS_L1_A_BSS *(.l1.bss)
167# define LDS_L1_A_CACHE *(.data_l1.cacheline_aligned)
168#else
169# define LDS_L1_A_DATA
170# define LDS_L1_A_BSS
171# define LDS_L1_A_CACHE
172#endif
Mike Frysingerde6a9522007-06-11 17:27:05 +0800173 .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
Bryan Wu1394f032007-05-06 14:50:22 -0700174 {
175 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800176 __sdata_l1 = .;
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800177 LDS_L1_A_DATA
Mike Frysingerde6a9522007-06-11 17:27:05 +0800178 __edata_l1 = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700179
180 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800181 __sbss_l1 = .;
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800182 LDS_L1_A_BSS
Bryan Wu1394f032007-05-06 14:50:22 -0700183
184 . = ALIGN(32);
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800185 LDS_L1_A_CACHE
Bryan Wu1394f032007-05-06 14:50:22 -0700186
187 . = ALIGN(4);
Mike Frysingerde6a9522007-06-11 17:27:05 +0800188 __ebss_l1 = .;
189 }
190
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800191#if L1_DATA_B_LENGTH
192# define LDS_L1_B_DATA *(.l1.data.B)
193# define LDS_L1_B_BSS *(.l1.bss.B)
194#else
195# define LDS_L1_B_DATA
196# define LDS_L1_B_BSS
197#endif
Mike Frysingerde6a9522007-06-11 17:27:05 +0800198 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
Bryan Wu1394f032007-05-06 14:50:22 -0700199 {
200 . = ALIGN(4);
201 __sdata_b_l1 = .;
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800202 LDS_L1_B_DATA
Bryan Wu1394f032007-05-06 14:50:22 -0700203 __edata_b_l1 = .;
204
205 . = ALIGN(4);
206 __sbss_b_l1 = .;
Mike Frysinger8b07a2a2008-02-29 11:57:35 +0800207 LDS_L1_B_BSS
Bryan Wu1394f032007-05-06 14:50:22 -0700208
209 . = ALIGN(4);
210 __ebss_b_l1 = .;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800211 }
Bryan Wu1394f032007-05-06 14:50:22 -0700212
Mike Frysinger36208052007-10-30 12:00:02 +0800213 /* Force trailing alignment of our init section so that when we
214 * free our init memory, we don't leave behind a partial page.
215 */
216 . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
217 . = ALIGN(PAGE_SIZE);
218 ___init_end = .;
Bryan Wu1394f032007-05-06 14:50:22 -0700219
Mike Frysingerb7627ac2008-02-02 15:53:17 +0800220 __end =.;
Mike Frysingerde6a9522007-06-11 17:27:05 +0800221
Mike Frysingerc11b5772007-10-11 00:12:41 +0800222 STABS_DEBUG
223
224 DWARF_DEBUG
225
226 NOTES
227
Mike Frysingerde6a9522007-06-11 17:27:05 +0800228 /DISCARD/ :
229 {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100230 EXIT_TEXT
231 EXIT_DATA
Mike Frysingerde6a9522007-06-11 17:27:05 +0800232 *(.exitcall.exit)
233 }
Bryan Wu1394f032007-05-06 14:50:22 -0700234}