vmlinux.lds.S 4.7 KB
Newer Older
B
Bryan Wu 已提交
1 2 3 4 5 6 7 8 9
/*
 * File:         arch/blackfin/kernel/vmlinux.lds.S
 * Based on:     none - original work
 * Author:
 *
 * Created:      Tue Sep 21 2004
 * Description:  Master linker script for blackfin architecture
 *
 * Modified:
10
 *               Copyright 2004-2007 Analog Devices Inc.
B
Bryan Wu 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
 *
 * Bugs:         Enter bugs at http://blackfin.uclinux.org/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see the file COPYING, or write
 * to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#define VMLINUX_SYMBOL(_sym_) _##_sym_

#include <asm-generic/vmlinux.lds.h>
#include <asm/mem_map.h>
34
#include <asm/page.h>
35
#include <asm/thread_info.h>
B
Bryan Wu 已提交
36 37 38 39 40 41 42 43

OUTPUT_FORMAT("elf32-bfin")
ENTRY(__start)
_jiffies = _jiffies_64;

SECTIONS
{
	. = CONFIG_BOOT_LOAD;
44 45 46
	/* Neither the text, ro_data or bss section need to be aligned
	 * So pack them back to back
	 */
B
Bryan Wu 已提交
47 48
	.text :
	{
49 50 51
		__text = .;
		_text = .;
		__stext = .;
52
		TEXT_TEXT
B
Bryan Wu 已提交
53
		SCHED_TEXT
54
		LOCK_TEXT
55 56
		KPROBES_TEXT
		*(.text.*)
57 58
		*(.fixup)

59 60 61 62
#if !L1_CODE_LENGTH
		*(.l1.text)
#endif

B
Bryan Wu 已提交
63
		. = ALIGN(16);
64
		___start___ex_table = .;
B
Bryan Wu 已提交
65
		*(__ex_table)
66
		___stop___ex_table = .;
B
Bryan Wu 已提交
67 68

		__etext = .;
69 70
	}

71 72 73 74 75 76 77 78 79
	/* Just in case the first read only is a 32-bit access */
	RO_DATA(4)

	.bss :
	{
		. = ALIGN(4);
		___bss_start = .;
		*(.bss .bss.*)
		*(COMMON)
80 81 82 83 84 85
#if !L1_DATA_A_LENGTH
		*(.l1.bss)
#endif
#if !L1_DATA_B_LENGTH
		*(.l1.bss.B)
#endif
86
		. = ALIGN(4);
87 88
		___bss_stop = .;
	}
89 90 91 92

	.data :
	{
		__sdata = .;
93
		/* This gets done first, so the glob doesn't suck it in */
94 95 96
		. = ALIGN(32);
		*(.data.cacheline_aligned)

97 98 99
#if !L1_DATA_A_LENGTH
		. = ALIGN(32);
		*(.data_l1.cacheline_aligned)
100 101 102 103
		*(.l1.data)
#endif
#if !L1_DATA_B_LENGTH
		*(.l1.data.B)
104
#endif
105
#if !L2_LENGTH
106 107 108 109
		. = ALIGN(32);
		*(.data_l2.cacheline_aligned)
		*(.l2.data)
#endif
110

111 112 113 114
		DATA_DATA
		*(.data.*)
		CONSTRUCTORS

115 116 117 118
		/* make sure the init_task is aligned to the
		 * kernel thread size so we can locate the kernel
		 * stack properly and quickly.
		 */
119
		. = ALIGN(THREAD_SIZE);
120 121
		*(.init_task.data)

122 123
		__edata = .;
	}
B
Bryan Wu 已提交
124

125 126 127 128 129 130
	/* The init section should be last, so when we free it, it goes into
	 * the general memory pool, and (hopefully) will decrease fragmentation
	 * a tiny bit. The init section has a _requirement_ that it be
	 * PAGE_SIZE aligned
	 */
	. = ALIGN(PAGE_SIZE);
131
	___init_begin = .;
132 133

	.init.text :
B
Bryan Wu 已提交
134
	{
135
		. = ALIGN(PAGE_SIZE);
B
Bryan Wu 已提交
136
		__sinittext = .;
137
		INIT_TEXT
B
Bryan Wu 已提交
138
		__einittext = .;
139 140 141 142
	}
	.init.data :
	{
		. = ALIGN(16);
143
		INIT_DATA
144 145 146
	}
	.init.setup :
	{
B
Bryan Wu 已提交
147 148 149 150
		. = ALIGN(16);
		___setup_start = .;
		*(.init.setup)
		___setup_end = .;
151 152 153
	}
	.initcall.init :
	{
B
Bryan Wu 已提交
154 155 156
		___initcall_start = .;
		INITCALLS
		___initcall_end = .;
157 158 159
	}
	.con_initcall.init :
	{
B
Bryan Wu 已提交
160 161 162
		___con_initcall_start = .;
		*(.con_initcall.init)
		___con_initcall_end = .;
163 164 165 166
	}
	SECURITY_INIT
	.init.ramfs :
	{
B
Bryan Wu 已提交
167 168 169 170
		. = ALIGN(4);
		___initramfs_start = .;
		*(.init.ramfs)
		___initramfs_end = .;
171
	}
B
Bryan Wu 已提交
172

173
	__l1_lma_start = .;
B
Bryan Wu 已提交
174

175
	.text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
B
Bryan Wu 已提交
176 177
	{
		. = ALIGN(4);
178
		__stext_l1 = .;
179
		*(.l1.text)
B
Bryan Wu 已提交
180
		. = ALIGN(4);
181 182
		__etext_l1 = .;
	}
B
Bryan Wu 已提交
183

184
	.data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
B
Bryan Wu 已提交
185 186
	{
		. = ALIGN(4);
187
		__sdata_l1 = .;
188
		*(.l1.data)
189
		__edata_l1 = .;
B
Bryan Wu 已提交
190 191

		. = ALIGN(32);
192
		*(.data_l1.cacheline_aligned)
B
Bryan Wu 已提交
193

194 195 196
		. = ALIGN(4);
		__sbss_l1 = .;
		*(.l1.bss)
B
Bryan Wu 已提交
197
		. = ALIGN(4);
198 199 200 201
		__ebss_l1 = .;
	}

	.data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
B
Bryan Wu 已提交
202 203 204
	{
		. = ALIGN(4);
		__sdata_b_l1 = .;
205
		*(.l1.data.B)
B
Bryan Wu 已提交
206 207 208 209
		__edata_b_l1 = .;

		. = ALIGN(4);
		__sbss_b_l1 = .;
210
		*(.l1.bss.B)
B
Bryan Wu 已提交
211 212
		. = ALIGN(4);
		__ebss_b_l1 = .;
213
	}
B
Bryan Wu 已提交
214

215 216 217 218 219 220
	__l2_lma_start = .;

	.text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
	{
		. = ALIGN(4);
		__stext_l2 = .;
221
		*(.l2.text)
222 223 224 225 226
		. = ALIGN(4);
		__etext_l2 = .;

		. = ALIGN(4);
		__sdata_l2 = .;
227
		*(.l2.data)
228 229 230 231 232 233 234
		__edata_l2 = .;

		. = ALIGN(32);
		*(.data_l2.cacheline_aligned)

		. = ALIGN(4);
		__sbss_l2 = .;
235
		*(.l2.bss)
236 237 238 239
		. = ALIGN(4);
		__ebss_l2 = .;
	}

240 241 242 243 244 245 246
	/* Force trailing alignment of our init section so that when we
	 * free our init memory, we don't leave behind a partial page.
	 */
	. = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
	. = ALIGN(PAGE_SIZE);
	___init_end = .;

247
	__end =.;
248

249 250 251 252
	STABS_DEBUG

	DWARF_DEBUG

253 254
	/DISCARD/ :
	{
255 256
		EXIT_TEXT
		EXIT_DATA
257 258
		*(.exitcall.exit)
	}
B
Bryan Wu 已提交
259
}