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 87
		___bss_stop = .;
	}
88 89 90 91

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

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

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

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

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

124 125 126 127 128 129
	/* 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);
130
	___init_begin = .;
131 132

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

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

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

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

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

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

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

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

214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
#ifdef L2_LENGTH
	__l2_lma_start = .;

	.text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
	{
		. = ALIGN(4);
		__stext_l2 = .;
		*(.l1.text)
		. = ALIGN(4);
		__etext_l2 = .;

		. = ALIGN(4);
		__sdata_l2 = .;
		*(.l1.data)
		__edata_l2 = .;

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

		. = ALIGN(4);
		__sbss_l2 = .;
		*(.l1.bss)
		. = ALIGN(4);
		__ebss_l2 = .;
	}
#endif

241 242 243 244 245 246 247
	/* 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 = .;

248
	__end =.;
249

250 251 252 253
	STABS_DEBUG

	DWARF_DEBUG

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