vmlinux.lds.S 4.3 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 104
#endif

105 106 107 108
		DATA_DATA
		*(.data.*)
		CONSTRUCTORS

109 110 111 112
		/* make sure the init_task is aligned to the
		 * kernel thread size so we can locate the kernel
		 * stack properly and quickly.
		 */
113
		. = ALIGN(THREAD_SIZE);
114 115
		*(.init_task.data)

116 117
		__edata = .;
	}
B
Bryan Wu 已提交
118

119 120 121 122 123 124
	/* 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);
125
	___init_begin = .;
126 127

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

167
	__l1_lma_start = .;
B
Bryan Wu 已提交
168

169
	.text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
B
Bryan Wu 已提交
170 171
	{
		. = ALIGN(4);
172
		__stext_l1 = .;
173
		*(.l1.text)
B
Bryan Wu 已提交
174
		. = ALIGN(4);
175 176
		__etext_l1 = .;
	}
B
Bryan Wu 已提交
177

178
	.data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
B
Bryan Wu 已提交
179 180
	{
		. = ALIGN(4);
181
		__sdata_l1 = .;
182
		*(.l1.data)
183
		__edata_l1 = .;
B
Bryan Wu 已提交
184 185

		. = ALIGN(4);
186
		__sbss_l1 = .;
187
		*(.l1.bss)
B
Bryan Wu 已提交
188 189

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

		. = ALIGN(4);
193 194 195 196
		__ebss_l1 = .;
	}

	.data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
B
Bryan Wu 已提交
197 198 199
	{
		. = ALIGN(4);
		__sdata_b_l1 = .;
200
		*(.l1.data.B)
B
Bryan Wu 已提交
201 202 203 204
		__edata_b_l1 = .;

		. = ALIGN(4);
		__sbss_b_l1 = .;
205
		*(.l1.bss.B)
B
Bryan Wu 已提交
206 207 208

		. = ALIGN(4);
		__ebss_b_l1 = .;
209
	}
B
Bryan Wu 已提交
210

211 212 213 214 215 216 217
	/* 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 = .;

218
	__end =.;
219

220 221 222 223
	STABS_DEBUG

	DWARF_DEBUG

224 225
	/DISCARD/ :
	{
226 227
		EXIT_TEXT
		EXIT_DATA
228 229
		*(.exitcall.exit)
	}
B
Bryan Wu 已提交
230
}