patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / v850 / kernel / vmlinux.lds.S
1 /*
2  * arch/v850/vmlinux.lds.S -- kernel linker script for v850 platforms
3  *
4  *  Copyright (C) 2002,03  NEC Electronics Corporation
5  *  Copyright (C) 2002,03  Miles Bader <miles@gnu.org>
6  *
7  * This file is subject to the terms and conditions of the GNU General
8  * Public License.  See the file COPYING in the main directory of this
9  * archive for more details.
10  *
11  * Written by Miles Bader <miles@gnu.org>
12  */
13
14 #include <linux/config.h>
15 #define VMLINUX_SYMBOL(_sym_) _##_sym_
16 #include <asm-generic/vmlinux.lds.h>
17
18 /* For most platforms, this will define useful things like RAM addr/size.  */
19 #include <asm/machdep.h>
20
21
22 /* The following macros contain the usual definitions for various data areas.
23    The prefix `RAMK_' is used to indicate macros suitable for kernels loaded
24    into RAM, and similarly `ROMK_' for ROM-resident kernels.  Note that all
25    symbols are prefixed with an extra `_' for compatibility with the v850
26    toolchain.  */
27
28         
29 /* Interrupt vectors.  */
30 #define INTV_CONTENTS                                                         \
31                 . = ALIGN (0x10) ;                                            \
32                 __intv_start = . ;                                            \
33                         *(.intv.reset)  /* Reset vector */                    \
34                 . = __intv_start + 0x10 ;                                     \
35                         *(.intv.common) /* Vectors common to all v850e proc */\
36                 . = __intv_start + 0x80 ;                                     \
37                         *(.intv.mach)   /* Machine-specific int. vectors.  */ \
38                 __intv_end = . ;
39
40 #define RODATA_CONTENTS                                                       \
41                 . = ALIGN (16) ;                                              \
42                         *(.rodata) *(.rodata.*)                               \
43                         *(__vermagic)           /* Kernel version magic */    \
44                         *(.rodata1)                                           \
45                 /* Kernel symbol table: Normal symbols */                     \
46                 ___start___ksymtab = .;                                       \
47                         *(__ksymtab)                                          \
48                 ___stop___ksymtab = .;                                        \
49                 /* Kernel symbol table: GPL-only symbols */                   \
50                 ___start___ksymtab_gpl = .;                                   \
51                         *(__ksymtab_gpl)                                      \
52                 ___stop___ksymtab_gpl = .;                                    \
53                 /* Kernel symbol table: strings */                            \
54                         *(__ksymtab_strings)                                  \
55                 /* Kernel symbol table: Normal symbols */                     \
56                 ___start___kcrctab = .;                                       \
57                         *(__kcrctab)                                          \
58                 ___stop___kcrctab = .;                                        \
59                 /* Kernel symbol table: GPL-only symbols */                   \
60                 ___start___kcrctab_gpl = .;                                   \
61                         *(__kcrctab_gpl)                                      \
62                 ___stop___kcrctab_gpl = .;                                    \
63
64 /* Kernel text segment, and some constant data areas.  */
65 #define TEXT_CONTENTS                                                         \
66                 __stext = . ;                                                 \
67                 *(.text)                                                      \
68                 SCHED_TEXT
69                         *(.exit.text)   /* 2.5 convention */                  \
70                         *(.text.exit)   /* 2.4 convention */                  \
71                         *(.text.lock)                                         \
72                         *(.exitcall.exit)                                     \
73                 __real_etext = . ;      /* There may be data after here.  */  \
74                 RODATA_CONTENTS                                               \
75                 . = ALIGN (4) ;                                               \
76                         *(.call_table_data)                                   \
77                         *(.call_table_text)                                   \
78                 . = ALIGN (16) ;        /* Exception table.  */               \
79                 ___start___ex_table = . ;                                     \
80                         *(__ex_table)                                         \
81                 ___stop___ex_table = . ;                                      \
82                 . = ALIGN (4) ;                                               \
83                 __etext = . ;
84
85 /* Kernel data segment.  */
86 #define DATA_CONTENTS                                                         \
87                 __sdata = . ;                                                 \
88                 *(.data)                                                      \
89                         *(.exit.data)   /* 2.5 convention */                  \
90                         *(.data.exit)   /* 2.4 convention */                  \
91                 . = ALIGN (16) ;                                              \
92                 *(.data.cacheline_aligned)                                    \
93                 . = ALIGN (0x2000) ;                                          \
94                 *(.data.init_task)                                            \
95                 . = ALIGN (0x2000) ;                                          \
96                 __edata = . ;
97
98 /* Kernel BSS segment.  */
99 #define BSS_CONTENTS                                                          \
100                 __sbss = . ;                                                  \
101                         *(.bss)                                               \
102                         *(COMMON)                                             \
103                 . = ALIGN (4) ;                                               \
104                 __init_stack_end = . ;                                        \
105                 __ebss = . ;
106
107 /* `initcall' tables.  */
108 #define INITCALL_CONTENTS                                                     \
109                 . = ALIGN (16) ;                                              \
110                 ___setup_start = . ;                                          \
111                         *(.init.setup)  /* 2.5 convention */                  \
112                         *(.setup.init)  /* 2.4 convention */                  \
113                 ___setup_end = . ;                                            \
114                 ___start___param = . ;                                        \
115                         *(__param)                                            \
116                 ___stop___param = . ;                                         \
117                 ___initcall_start = . ;                                       \
118                         *(.initcall.init)                                     \
119                         *(.initcall1.init)                                    \
120                         *(.initcall2.init)                                    \
121                         *(.initcall3.init)                                    \
122                         *(.initcall4.init)                                    \
123                         *(.initcall5.init)                                    \
124                         *(.initcall6.init)                                    \
125                         *(.initcall7.init)                                    \
126                 . = ALIGN (4) ;                                               \
127                 ___initcall_end = . ;                                         \
128                 ___con_initcall_start = .;                                    \
129                         *(.con_initcall.init)                                 \
130                 ___con_initcall_end = .;
131
132 /* Contents of `init' section for a kernel that's loaded into RAM.  */
133 #define RAMK_INIT_CONTENTS                                                    \
134                 RAMK_INIT_CONTENTS_NO_END                                     \
135                 __init_end = . ;
136 /* Same as RAMK_INIT_CONTENTS, but doesn't define the `__init_end' symbol.  */
137 #define RAMK_INIT_CONTENTS_NO_END                                             \
138                 . = ALIGN (4096) ;                                            \
139                 __init_start = . ;                                            \
140                         __sinittext = .;                                      \
141                         *(.init.text)   /* 2.5 convention */                  \
142                         __einittext = .;                                      \
143                         *(.init.data)                                         \
144                         *(.text.init)   /* 2.4 convention */                  \
145                         *(.data.init)                                         \
146                 INITCALL_CONTENTS                                             \
147                 INITRAMFS_CONTENTS
148
149 /* The contents of `init' section for a ROM-resident kernel which
150    should go into RAM.  */      
151 #define ROMK_INIT_RAM_CONTENTS                                                \
152                 . = ALIGN (4096) ;                                            \
153                 __init_start = . ;                                            \
154                         *(.init.data)   /* 2.5 convention */                  \
155                         *(.data.init)   /* 2.4 convention */                  \
156                 __init_end = . ;                                              \
157                 . = ALIGN (4096) ;
158
159 /* The contents of `init' section for a ROM-resident kernel which
160    should go into ROM.  */      
161 #define ROMK_INIT_ROM_CONTENTS                                                \
162                         _sinittext = .;                                       \
163                         *(.init.text)   /* 2.5 convention */                  \
164                         _einittext = .;                                       \
165                         *(.text.init)   /* 2.4 convention */                  \
166                 INITCALL_CONTENTS                                             \
167                 INITRAMFS_CONTENTS
168
169 /* A root filesystem image, for kernels with an embedded root filesystem.  */
170 #define ROOT_FS_CONTENTS                                                      \
171                 __root_fs_image_start = . ;                                   \
172                 *(.root)                                                      \
173                 __root_fs_image_end = . ;
174 /* The initramfs archive.  */
175 #define INITRAMFS_CONTENTS                                                    \
176                 . = ALIGN (4) ;                                               \
177                 ___initramfs_start = . ;                                      \
178                         *(.init.ramfs)                                        \
179                 ___initramfs_end = . ;
180 /* Where the initial bootmap (bitmap for the boot-time memory allocator) 
181    should be place.  */
182 #define BOOTMAP_CONTENTS                                                      \
183                 . = ALIGN (4096) ;                                            \
184                 __bootmap = . ;                                               \
185                 . = . + 4096 ;          /* enough for 128MB.   */
186
187 /* The contents of a `typical' kram area for a kernel in RAM.  */
188 #define RAMK_KRAM_CONTENTS                                                    \
189                 __kram_start = . ;                                            \
190                 TEXT_CONTENTS                                                 \
191                 DATA_CONTENTS                                                 \
192                 BSS_CONTENTS                                                  \
193                 RAMK_INIT_CONTENTS                                            \
194                 __kram_end = . ;                                              \
195                 BOOTMAP_CONTENTS
196
197
198 /* Define output sections normally used for a ROM-resident kernel.  
199    ROM and RAM should be appropriate memory areas to use for kernel
200    ROM and RAM data.  This assumes that ROM starts at 0 (and thus can
201    hold the interrupt vectors).  */
202 #define ROMK_SECTIONS(ROM, RAM)                                               \
203         .rom : {                                                              \
204                 INTV_CONTENTS                                                 \
205                 TEXT_CONTENTS                                                 \
206                 ROMK_INIT_ROM_CONTENTS                                        \
207                 ROOT_FS_CONTENTS                                              \
208         } > ROM                                                               \
209                                                                               \
210         __rom_copy_src_start = . ;                                            \
211                                                                               \
212         .data : {                                                             \
213                 __kram_start = . ;                                            \
214                 __rom_copy_dst_start = . ;                                    \
215                 DATA_CONTENTS                                                 \
216                 ROMK_INIT_RAM_CONTENTS                                        \
217                 __rom_copy_dst_end = . ;                                      \
218         } > RAM  AT> ROM                                                      \
219                                                                               \
220         .bss ALIGN (4) : {                                                    \
221                 BSS_CONTENTS                                                  \
222                 __kram_end = . ;                                              \
223                 BOOTMAP_CONTENTS                                              \
224         } > RAM
225
226
227 /* The 32-bit variable `jiffies' is just the lower 32-bits of `jiffies_64'.  */
228 _jiffies = _jiffies_64 ;
229
230
231 /* Include an appropriate platform-dependent linker-script (which
232    usually should use the above macros to do most of the work).  */
233
234 #ifdef CONFIG_V850E_SIM
235 # include "sim.ld"
236 #endif
237
238 #ifdef CONFIG_V850E2_SIM85E2
239 # include "sim85e2.ld"
240 #endif
241
242 #ifdef CONFIG_V850E2_FPGA85E2C
243 # include "fpga85e2c.ld"
244 #endif
245
246 #ifdef CONFIG_V850E2_ANNA
247 # ifdef CONFIG_ROM_KERNEL
248 #  include "anna-rom.ld"
249 # else
250 #  include "anna.ld"
251 # endif
252 #endif
253
254 #ifdef CONFIG_V850E_AS85EP1
255 # ifdef CONFIG_ROM_KERNEL
256 #  include "as85ep1-rom.ld"
257 # else
258 #  include "as85ep1.ld"
259 # endif
260 #endif
261
262 #ifdef CONFIG_RTE_CB_MA1
263 # ifdef CONFIG_ROM_KERNEL
264 #  include "rte_ma1_cb-rom.ld"
265 # else
266 #  include "rte_ma1_cb.ld"
267 # endif
268 #endif
269
270 #ifdef CONFIG_RTE_CB_NB85E
271 # ifdef CONFIG_ROM_KERNEL
272 #  include "rte_nb85e_cb-rom.ld"
273 # elif defined(CONFIG_RTE_CB_MULTI)
274 #  include "rte_nb85e_cb-multi.ld"
275 # else
276 #  include "rte_nb85e_cb.ld"
277 # endif
278 #endif
279
280 #ifdef CONFIG_RTE_CB_ME2
281 #  include "rte_me2_cb.ld"
282 #endif
283