xtensa: use DATA_DATA in xtensa
[linux-2.6/pdupreez.git] / arch / xtensa / kernel / vmlinux.lds.S
blobbb3f1f3097a878588fcc2e8b0c3136a49f490186
1 /*
2  * arch/xtensa/kernel/vmlinux.lds.S
3  *
4  * Xtensa linker script
5  *
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
8  * for more details.
9  *
10  * Copyright (C) 2001 - 2005 Tensilica Inc.
11  *
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>
15  */
17 #include <asm-generic/vmlinux.lds.h>
19 #include <asm/variant/core.h>
20 OUTPUT_ARCH(xtensa)
21 ENTRY(_start)
23 #ifdef __XTENSA_EB__
24 jiffies = jiffies_64 + 4;
25 #else
26 jiffies = jiffies_64;
27 #endif
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
37    between them.  */
39 /* Macro for a relocation entry */
41 #define RELOCATE_ENTRY(sym, section)            \
42         LONG(sym ## _start);                    \
43         LONG(sym ## _end);                      \
44         LONG(LOADADDR(section))
46 /* Macro to define a section for a vector.
47  *
48  * Use of the MIN function catches the types of errors illustrated in
49  * the following example:
50  *
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
57  * garbage.)
58  */
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)   \
63   {                                                                         \
64     . = ALIGN(4);                                                           \
65     sym ## _start = ABSOLUTE(.);                                            \
66     *(section)                                                              \
67     sym ## _end = ABSOLUTE(.);                                              \
68   }
71  *  Mapping of input sections to output sections when linking.
72  */
74 SECTIONS
76   . = KERNELOFFSET;
77   /* .text section */
79   _text = .;
80   _stext = .;
81   _ftext = .;
83   .text :
84   {
85     /* The .head.text section must be the first section! */
86     *(.head.text)
87     *(.literal .text)
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) = .;
95   }
96   _etext = .;
97   PROVIDE (etext = .);
99   . = ALIGN(16);
101   RODATA
103   /*  Relocation table */
105   .fixup   : { *(.fixup) }
107   . = ALIGN(16);
109   __ex_table : {
110     __start___ex_table = .;
111     *(__ex_table)
112     __stop___ex_table = .;
113   }
115   /* Data section */
117   . = ALIGN(XCHAL_ICACHE_LINESIZE);
118   _fdata = .;
119   .data :
120   {
121     DATA_DATA
122     CONSTRUCTORS
123     . = ALIGN(XCHAL_ICACHE_LINESIZE);
124     *(.data.cacheline_aligned)
125   }
127   _edata = .;
129   /* The initial task */
130   . = ALIGN(8192);
131   .data.init_task : { *(.data.init_task) }
133   /* Initialization code and data: */
135   . = ALIGN(1 << 12);
136   __init_begin = .;
137   .init.text : {
138         _sinittext = .;
139         *(.init.literal) *(.init.text)
140         _einittext = .;
141   }
143   .init.data :
144   {
145     *(.init.data)
146     . = ALIGN(0x4);
147     __tagtable_begin = .;
148     *(.taglist)
149     __tagtable_end = .;
151     . = ALIGN(16);
152     __boot_reloc_table_start = ABSOLUTE(.);
154     RELOCATE_ENTRY(_WindowVectors_text,
155                    .WindowVectors.text);
156     RELOCATE_ENTRY(_KernelExceptionVector_text,
157                    .KernelExceptionVector.text);
158     RELOCATE_ENTRY(_UserExceptionVector_text,
159                    .UserExceptionVector.text);
160     RELOCATE_ENTRY(_DoubleExceptionVector_literal,
161                    .DoubleExceptionVector.literal);
162     RELOCATE_ENTRY(_DoubleExceptionVector_text,
163                    .DoubleExceptionVector.text);
164   
165     __boot_reloc_table_end = ABSOLUTE(.) ;
166   }
168   . = ALIGN(XCHAL_ICACHE_LINESIZE);
170   __setup_start = .;
171   .init.setup : { *(.init.setup) }
172   __setup_end = .;
174   __initcall_start = .;
175   .initcall.init : {
176         INITCALLS
177   }
178   __initcall_end = .;
180   __con_initcall_start = .;
181   .con_initcall.init : { *(.con_initcall.init) }
182   __con_initcall_end = .;
184   SECURITY_INIT
187 #ifdef CONFIG_BLK_DEV_INITRD
188   . = ALIGN(4096);
189   __initramfs_start =.;
190   .init.ramfs : { *(.init.ramfs) }
191   __initramfs_end = .;
192 #endif
194   . = ALIGN(4096);
195   __per_cpu_start = .;
196   .data.percpu  : { *(.data.percpu) }
197   __per_cpu_end = .;
200   /* We need this dummy segment here */
202   . = ALIGN(4);
203   .dummy : { LONG(0) }
205   /* The vectors are relocated to the real position at startup time */
207   SECTION_VECTOR (_WindowVectors_text,
208                   .WindowVectors.text,
209                   XCHAL_WINDOW_VECTORS_VADDR, 4,
210                   .dummy)
211   SECTION_VECTOR (_DebugInterruptVector_literal,
212                   .DebugInterruptVector.literal,
213                   XCHAL_DEBUG_VECTOR_VADDR - 4,
214                   SIZEOF(.WindowVectors.text),
215                   .WindowVectors.text)
216   SECTION_VECTOR (_DebugInterruptVector_text,
217                   .DebugInterruptVector.text,
218                   XCHAL_DEBUG_VECTOR_VADDR,
219                   4,
220                   .DebugInterruptVector.literal)
221   SECTION_VECTOR (_KernelExceptionVector_literal,
222                   .KernelExceptionVector.literal,
223                   XCHAL_KERNEL_VECTOR_VADDR - 4,
224                   SIZEOF(.DebugInterruptVector.text),
225                   .DebugInterruptVector.text)
226   SECTION_VECTOR (_KernelExceptionVector_text,
227                   .KernelExceptionVector.text,
228                   XCHAL_KERNEL_VECTOR_VADDR,
229                   4,
230                   .KernelExceptionVector.literal)
231   SECTION_VECTOR (_UserExceptionVector_literal,
232                   .UserExceptionVector.literal,
233                   XCHAL_USER_VECTOR_VADDR - 4,
234                   SIZEOF(.KernelExceptionVector.text),
235                   .KernelExceptionVector.text)
236   SECTION_VECTOR (_UserExceptionVector_text,
237                   .UserExceptionVector.text,
238                   XCHAL_USER_VECTOR_VADDR,
239                   4,
240                   .UserExceptionVector.literal)
241   SECTION_VECTOR (_DoubleExceptionVector_literal,
242                   .DoubleExceptionVector.literal,
243                   XCHAL_DOUBLEEXC_VECTOR_VADDR - 16,
244                   SIZEOF(.UserExceptionVector.text),
245                   .UserExceptionVector.text)
246   SECTION_VECTOR (_DoubleExceptionVector_text,
247                   .DoubleExceptionVector.text,
248                   XCHAL_DOUBLEEXC_VECTOR_VADDR,
249                   32,
250                   .DoubleExceptionVector.literal)
252   . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;
253   . = ALIGN(1 << 12);
255   __init_end = .;
257   . = ALIGN(8192);
259   /* BSS section */
260   _bss_start = .;
261   .bss : { *(.bss.page_aligned) *(.bss) }
262   _bss_end = .;
264   _end = .;
266   /* only used by the boot loader  */
268   . = ALIGN(0x10);
269   .bootstrap : { *(.bootstrap.literal .bootstrap.text .bootstrap.data) }
271   . = ALIGN(0x1000);
272   __initrd_start = .;
273   .initrd : { *(.initrd) }
274   __initrd_end = .;
276   .ResetVector.text XCHAL_RESET_VECTOR_VADDR :
277   {
278     *(.ResetVector.text)
279   }
281   /* Sections to be discarded */
282   /DISCARD/ :
283   {
284         *(.exit.literal .exit.text)
285         *(.exit.data)
286         *(.exitcall.exit)
287   }
289   .xt.lit : { *(.xt.lit) }
290   .xt.prop : { *(.xt.prop) }
292   .debug  0 :  { *(.debug) }
293   .line  0 :  { *(.line) }
294   .debug_srcinfo  0 :  { *(.debug_srcinfo) }
295   .debug_sfnames  0 :  { *(.debug_sfnames) }
296   .debug_aranges  0 :  { *(.debug_aranges) }
297   .debug_pubnames  0 :  { *(.debug_pubnames) }
298   .debug_info  0 :  { *(.debug_info) }
299   .debug_abbrev  0 :  { *(.debug_abbrev) }
300   .debug_line  0 :  { *(.debug_line) }
301   .debug_frame  0 :  { *(.debug_frame) }
302   .debug_str  0 :  { *(.debug_str) }
303   .debug_loc  0 :  { *(.debug_loc) }
304   .debug_macinfo  0 :  { *(.debug_macinfo) }
305   .debug_weaknames  0 :  { *(.debug_weaknames) }
306   .debug_funcnames  0 :  { *(.debug_funcnames) }
307   .debug_typenames  0 :  { *(.debug_typenames) }
308   .debug_varnames  0 :  { *(.debug_varnames) }
310   .xt.insn 0 :
311   {
312     *(.xt.insn)
313     *(.gnu.linkonce.x*)
314   }
316   .xt.lit 0 :
317   {
318     *(.xt.lit)
319     *(.gnu.linkonce.p*)
320   }