2 * arch/xtensa/kernel/vmlinux.lds.S
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
12 * Chris Zankel <chris@zankel.net>
13 * Marc Gauthier <marc@tensilica.com, marc@alumni.uwaterloo.ca>
14 * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com>
17 #include <asm-generic/vmlinux.lds.h>
19 #include <asm/variant/core.h>
24 jiffies = jiffies_64 + 4;
29 #define KERNELOFFSET 0xd0001000
31 /* Note: In the following macros, it would be nice to specify only the
32 vector name and section kind and construct "sym" and "section" using
33 CPP concatenation, but that does not work reliably. Concatenating a
34 string with "." produces an invalid token. CPP will not print a
35 warning because it thinks this is an assembly file, but it leaves
36 them as multiple tokens and there may or may not be whitespace
39 /* Macro for a relocation entry */
41 #define RELOCATE_ENTRY(sym, section) \
42 LONG(sym ## _start); \
44 LONG(LOADADDR(section))
46 /* Macro to define a section for a vector.
48 * Use of the MIN function catches the types of errors illustrated in
49 * the following example:
51 * Assume the section .DoubleExceptionVector.literal is completely
52 * full. Then a programmer adds code to .DoubleExceptionVector.text
53 * that produces another literal. The final literal position will
54 * overlay onto the first word of the adjacent code section
55 * .DoubleExceptionVector.text. (In practice, the literals will
56 * overwrite the code, and the first few instructions will be
60 #define SECTION_VECTOR(sym, section, addr, max_prevsec_size, prevsec) \
61 section addr : AT((MIN(LOADADDR(prevsec) + max_prevsec_size, \
62 LOADADDR(prevsec) + SIZEOF(prevsec)) + 3) & ~ 3) \
65 sym ## _start = ABSOLUTE(.); \
67 sym ## _end = ABSOLUTE(.); \
71 * Mapping of input sections to output sections when linking.
85 /* The .head.text section must be the first section! */
88 VMLINUX_SYMBOL(__sched_text_start) = .;
89 *(.sched.literal .sched.text)
90 VMLINUX_SYMBOL(__sched_text_end) = .;
91 VMLINUX_SYMBOL(__lock_text_start) = .;
92 *(.spinlock.literal .spinlock.text)
93 VMLINUX_SYMBOL(__lock_text_end) = .;
103 /* Relocation table */
105 .fixup : { *(.fixup) }
110 __start___ex_table = .;
112 __stop___ex_table = .;
117 . = ALIGN(XCHAL_ICACHE_LINESIZE);
123 . = ALIGN(XCHAL_ICACHE_LINESIZE);
124 *(.data.cacheline_aligned)
129 /* The initial task */
131 .data.init_task : { *(.data.init_task) }
133 /* Initialization code and data: */
139 <<<<<<< HEAD:arch/xtensa/kernel/vmlinux.lds.S
140 *(.init.literal) INIT_TEXT
142 *(.init.literal) *(.cpuinit.literal)
143 *(.devinit.literal) *(.meminit.literal)
145 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a:arch/xtensa/kernel/vmlinux.lds.S
153 __tagtable_begin = .;
158 __boot_reloc_table_start = ABSOLUTE(.);
160 RELOCATE_ENTRY(_WindowVectors_text,
161 .WindowVectors.text);
162 RELOCATE_ENTRY(_KernelExceptionVector_text,
163 .KernelExceptionVector.text);
164 RELOCATE_ENTRY(_UserExceptionVector_text,
165 .UserExceptionVector.text);
166 RELOCATE_ENTRY(_DoubleExceptionVector_literal,
167 .DoubleExceptionVector.literal);
168 RELOCATE_ENTRY(_DoubleExceptionVector_text,
169 .DoubleExceptionVector.text);
170 <<<<<<< HEAD:arch/xtensa/kernel/vmlinux.lds.S
172 RELOCATE_ENTRY(_DebugInterruptVector_text,
173 .DebugInterruptVector.text);
174 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a:arch/xtensa/kernel/vmlinux.lds.S
176 __boot_reloc_table_end = ABSOLUTE(.) ;
179 . = ALIGN(XCHAL_ICACHE_LINESIZE);
182 .init.setup : { *(.init.setup) }
185 __initcall_start = .;
191 __con_initcall_start = .;
192 .con_initcall.init : { *(.con_initcall.init) }
193 __con_initcall_end = .;
198 #ifdef CONFIG_BLK_DEV_INITRD
200 __initramfs_start =.;
201 .init.ramfs : { *(.init.ramfs) }
208 /* We need this dummy segment here */
213 /* The vectors are relocated to the real position at startup time */
215 SECTION_VECTOR (_WindowVectors_text,
217 XCHAL_WINDOW_VECTORS_VADDR, 4,
219 SECTION_VECTOR (_DebugInterruptVector_literal,
220 .DebugInterruptVector.literal,
221 XCHAL_DEBUG_VECTOR_VADDR - 4,
222 SIZEOF(.WindowVectors.text),
224 SECTION_VECTOR (_DebugInterruptVector_text,
225 .DebugInterruptVector.text,
226 XCHAL_DEBUG_VECTOR_VADDR,
228 .DebugInterruptVector.literal)
229 SECTION_VECTOR (_KernelExceptionVector_literal,
230 .KernelExceptionVector.literal,
231 XCHAL_KERNEL_VECTOR_VADDR - 4,
232 SIZEOF(.DebugInterruptVector.text),
233 .DebugInterruptVector.text)
234 SECTION_VECTOR (_KernelExceptionVector_text,
235 .KernelExceptionVector.text,
236 XCHAL_KERNEL_VECTOR_VADDR,
238 .KernelExceptionVector.literal)
239 SECTION_VECTOR (_UserExceptionVector_literal,
240 .UserExceptionVector.literal,
241 XCHAL_USER_VECTOR_VADDR - 4,
242 SIZEOF(.KernelExceptionVector.text),
243 .KernelExceptionVector.text)
244 SECTION_VECTOR (_UserExceptionVector_text,
245 .UserExceptionVector.text,
246 XCHAL_USER_VECTOR_VADDR,
248 .UserExceptionVector.literal)
249 SECTION_VECTOR (_DoubleExceptionVector_literal,
250 .DoubleExceptionVector.literal,
251 XCHAL_DOUBLEEXC_VECTOR_VADDR - 16,
252 SIZEOF(.UserExceptionVector.text),
253 .UserExceptionVector.text)
254 SECTION_VECTOR (_DoubleExceptionVector_text,
255 .DoubleExceptionVector.text,
256 XCHAL_DOUBLEEXC_VECTOR_VADDR,
258 .DoubleExceptionVector.literal)
260 . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;
269 .bss : { *(.bss.page_aligned) *(.bss) }
274 /* only used by the boot loader */
277 .bootstrap : { *(.bootstrap.literal .bootstrap.text .bootstrap.data) }
281 .initrd : { *(.initrd) }
284 .ResetVector.text XCHAL_RESET_VECTOR_VADDR :
289 /* Sections to be discarded */
298 .xt.lit : { *(.xt.lit) }
299 .xt.prop : { *(.xt.prop) }
301 .debug 0 : { *(.debug) }
302 .line 0 : { *(.line) }
303 .debug_srcinfo 0 : { *(.debug_srcinfo) }
304 .debug_sfnames 0 : { *(.debug_sfnames) }
305 .debug_aranges 0 : { *(.debug_aranges) }
306 .debug_pubnames 0 : { *(.debug_pubnames) }
307 .debug_info 0 : { *(.debug_info) }
308 .debug_abbrev 0 : { *(.debug_abbrev) }
309 .debug_line 0 : { *(.debug_line) }
310 .debug_frame 0 : { *(.debug_frame) }
311 .debug_str 0 : { *(.debug_str) }
312 .debug_loc 0 : { *(.debug_loc) }
313 .debug_macinfo 0 : { *(.debug_macinfo) }
314 .debug_weaknames 0 : { *(.debug_weaknames) }
315 .debug_funcnames 0 : { *(.debug_funcnames) }
316 .debug_typenames 0 : { *(.debug_typenames) }
317 .debug_varnames 0 : { *(.debug_varnames) }