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