Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6] / 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,04,05  NEC Electronics Corporation
5  *  Copyright (C) 2002,03,04,05  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
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                 /* PCI quirks */                                              \
46                 ___start_pci_fixups_early = . ;                               \
47                         *(.pci_fixup_early)                                   \
48                 ___end_pci_fixups_early = . ;                                 \
49                 ___start_pci_fixups_header = . ;                              \
50                         *(.pci_fixup_header)                                  \
51                 ___end_pci_fixups_header = . ;                                \
52                 ___start_pci_fixups_final = . ;                               \
53                         *(.pci_fixup_final)                                   \
54                 ___end_pci_fixups_final = . ;                                 \
55                 ___start_pci_fixups_enable = . ;                              \
56                         *(.pci_fixup_enable)                                  \
57                 ___end_pci_fixups_enable = . ;                                \
58                 /* Kernel symbol table: Normal symbols */                     \
59                 ___start___ksymtab = .;                                       \
60                         *(__ksymtab)                                          \
61                 ___stop___ksymtab = .;                                        \
62                 /* Kernel symbol table: GPL-only symbols */                   \
63                 ___start___ksymtab_gpl = .;                                   \
64                         *(__ksymtab_gpl)                                      \
65                 ___stop___ksymtab_gpl = .;                                    \
66                 /* Kernel symbol table: GPL-future symbols */                 \
67                 ___start___ksymtab_gpl_future = .;                            \
68                         *(__ksymtab_gpl_future)                               \
69                 ___stop___ksymtab_gpl_future = .;                             \
70                 /* Kernel symbol table: strings */                            \
71                         *(__ksymtab_strings)                                  \
72                 /* Kernel symbol table: Normal symbols */                     \
73                 ___start___kcrctab = .;                                       \
74                         *(__kcrctab)                                          \
75                 ___stop___kcrctab = .;                                        \
76                 /* Kernel symbol table: GPL-only symbols */                   \
77                 ___start___kcrctab_gpl = .;                                   \
78                         *(__kcrctab_gpl)                                      \
79                 ___stop___kcrctab_gpl = .;                                    \
80                 /* Kernel symbol table: GPL-future symbols */                 \
81                 ___start___kcrctab_gpl_future = .;                            \
82                         *(__kcrctab_gpl_future)                               \
83                 ___stop___kcrctab_gpl_future = .;                             \
84                 /* Built-in module parameters */                              \
85                 . = ALIGN (4) ;                                               \
86                 ___start___param = .;                                         \
87                 *(__param)                                                    \
88                 ___stop___param = .;
89
90
91 /* Kernel text segment, and some constant data areas.  */
92 #define TEXT_CONTENTS                                                         \
93                 __stext = . ;                                                 \
94                 *(.text)                                                      \
95                 SCHED_TEXT                                                    \
96                         *(.exit.text)   /* 2.5 convention */                  \
97                         *(.text.exit)   /* 2.4 convention */                  \
98                         *(.text.lock)                                         \
99                         *(.exitcall.exit)                                     \
100                 __real_etext = . ;      /* There may be data after here.  */  \
101                 RODATA_CONTENTS                                               \
102                 . = ALIGN (4) ;                                               \
103                         *(.call_table_data)                                   \
104                         *(.call_table_text)                                   \
105                 . = ALIGN (16) ;        /* Exception table.  */               \
106                 ___start___ex_table = . ;                                     \
107                         *(__ex_table)                                         \
108                 ___stop___ex_table = . ;                                      \
109                 . = ALIGN (4) ;                                               \
110                 __etext = . ;
111
112 /* Kernel data segment.  */
113 #define DATA_CONTENTS                                                         \
114                 __sdata = . ;                                                 \
115                 *(.data)                                                      \
116                         *(.exit.data)   /* 2.5 convention */                  \
117                         *(.data.exit)   /* 2.4 convention */                  \
118                 . = ALIGN (16) ;                                              \
119                 *(.data.cacheline_aligned)                                    \
120                 . = ALIGN (0x2000) ;                                          \
121                 *(.data.init_task)                                            \
122                 . = ALIGN (0x2000) ;                                          \
123                 __edata = . ;
124
125 /* Kernel BSS segment.  */
126 #define BSS_CONTENTS                                                          \
127                 __sbss = . ;                                                  \
128                         *(.bss)                                               \
129                         *(COMMON)                                             \
130                 . = ALIGN (4) ;                                               \
131                 __init_stack_end = . ;                                        \
132                 __ebss = . ;
133
134 /* `initcall' tables.  */
135 #define INITCALL_CONTENTS                                                     \
136                 . = ALIGN (16) ;                                              \
137                 ___setup_start = . ;                                          \
138                         *(.init.setup)  /* 2.5 convention */                  \
139                         *(.setup.init)  /* 2.4 convention */                  \
140                 ___setup_end = . ;                                            \
141                 ___initcall_start = . ;                                       \
142                         *(.initcall.init)                                     \
143                         *(.initcall1.init)                                    \
144                         *(.initcall2.init)                                    \
145                         *(.initcall3.init)                                    \
146                         *(.initcall4.init)                                    \
147                         *(.initcall5.init)                                    \
148                         *(.initcall6.init)                                    \
149                         *(.initcall7.init)                                    \
150                 . = ALIGN (4) ;                                               \
151                 ___initcall_end = . ;                                         \
152                 ___con_initcall_start = .;                                    \
153                         *(.con_initcall.init)                                 \
154                 ___con_initcall_end = .;
155
156 /* Contents of `init' section for a kernel that's loaded into RAM.  */
157 #define RAMK_INIT_CONTENTS                                                    \
158                 RAMK_INIT_CONTENTS_NO_END                                     \
159                 __init_end = . ;
160 /* Same as RAMK_INIT_CONTENTS, but doesn't define the `__init_end' symbol.  */
161 #define RAMK_INIT_CONTENTS_NO_END                                             \
162                 . = ALIGN (4096) ;                                            \
163                 __init_start = . ;                                            \
164                         __sinittext = .;                                      \
165                         *(.init.text)   /* 2.5 convention */                  \
166                         __einittext = .;                                      \
167                         *(.init.data)                                         \
168                         *(.text.init)   /* 2.4 convention */                  \
169                         *(.data.init)                                         \
170                 INITCALL_CONTENTS                                             \
171                 INITRAMFS_CONTENTS
172
173 /* The contents of `init' section for a ROM-resident kernel which
174    should go into RAM.  */      
175 #define ROMK_INIT_RAM_CONTENTS                                                \
176                 . = ALIGN (4096) ;                                            \
177                 __init_start = . ;                                            \
178                         *(.init.data)   /* 2.5 convention */                  \
179                         *(.data.init)   /* 2.4 convention */                  \
180                 __init_end = . ;                                              \
181                 . = ALIGN (4096) ;
182
183 /* The contents of `init' section for a ROM-resident kernel which
184    should go into ROM.  */      
185 #define ROMK_INIT_ROM_CONTENTS                                                \
186                         _sinittext = .;                                       \
187                         *(.init.text)   /* 2.5 convention */                  \
188                         _einittext = .;                                       \
189                         *(.text.init)   /* 2.4 convention */                  \
190                 INITCALL_CONTENTS                                             \
191                 INITRAMFS_CONTENTS
192
193 /* A root filesystem image, for kernels with an embedded root filesystem.  */
194 #define ROOT_FS_CONTENTS                                                      \
195                 __root_fs_image_start = . ;                                   \
196                 *(.root)                                                      \
197                 __root_fs_image_end = . ;
198 /* The initramfs archive.  */
199 #define INITRAMFS_CONTENTS                                                    \
200                 . = ALIGN (4) ;                                               \
201                 ___initramfs_start = . ;                                      \
202                         *(.init.ramfs)                                        \
203                 ___initramfs_end = . ;
204 /* Where the initial bootmap (bitmap for the boot-time memory allocator) 
205    should be place.  */
206 #define BOOTMAP_CONTENTS                                                      \
207                 . = ALIGN (4096) ;                                            \
208                 __bootmap = . ;                                               \
209                 . = . + 4096 ;          /* enough for 128MB.   */
210
211 /* The contents of a `typical' kram area for a kernel in RAM.  */
212 #define RAMK_KRAM_CONTENTS                                                    \
213                 __kram_start = . ;                                            \
214                 TEXT_CONTENTS                                                 \
215                 DATA_CONTENTS                                                 \
216                 BSS_CONTENTS                                                  \
217                 RAMK_INIT_CONTENTS                                            \
218                 __kram_end = . ;                                              \
219                 BOOTMAP_CONTENTS
220
221
222 /* Define output sections normally used for a ROM-resident kernel.  
223    ROM and RAM should be appropriate memory areas to use for kernel
224    ROM and RAM data.  This assumes that ROM starts at 0 (and thus can
225    hold the interrupt vectors).  */
226 #define ROMK_SECTIONS(ROM, RAM)                                               \
227         .rom : {                                                              \
228                 INTV_CONTENTS                                                 \
229                 TEXT_CONTENTS                                                 \
230                 ROMK_INIT_ROM_CONTENTS                                        \
231                 ROOT_FS_CONTENTS                                              \
232         } > ROM                                                               \
233                                                                               \
234         __rom_copy_src_start = . ;                                            \
235                                                                               \
236         .data : {                                                             \
237                 __kram_start = . ;                                            \
238                 __rom_copy_dst_start = . ;                                    \
239                 DATA_CONTENTS                                                 \
240                 ROMK_INIT_RAM_CONTENTS                                        \
241                 __rom_copy_dst_end = . ;                                      \
242         } > RAM  AT> ROM                                                      \
243                                                                               \
244         .bss ALIGN (4) : {                                                    \
245                 BSS_CONTENTS                                                  \
246                 __kram_end = . ;                                              \
247                 BOOTMAP_CONTENTS                                              \
248         } > RAM
249
250
251 /* The 32-bit variable `jiffies' is just the lower 32-bits of `jiffies_64'.  */
252 _jiffies = _jiffies_64 ;
253
254
255 /* Include an appropriate platform-dependent linker-script (which
256    usually should use the above macros to do most of the work).  */
257
258 #ifdef CONFIG_V850E_SIM
259 # include "sim.ld"
260 #endif
261
262 #ifdef CONFIG_V850E2_SIM85E2
263 # include "sim85e2.ld"
264 #endif
265
266 #ifdef CONFIG_V850E2_FPGA85E2C
267 # include "fpga85e2c.ld"
268 #endif
269
270 #ifdef CONFIG_V850E2_ANNA
271 # ifdef CONFIG_ROM_KERNEL
272 #  include "anna-rom.ld"
273 # else
274 #  include "anna.ld"
275 # endif
276 #endif
277
278 #ifdef CONFIG_V850E_AS85EP1
279 # ifdef CONFIG_ROM_KERNEL
280 #  include "as85ep1-rom.ld"
281 # else
282 #  include "as85ep1.ld"
283 # endif
284 #endif
285
286 #ifdef CONFIG_RTE_CB_MA1
287 # ifdef CONFIG_ROM_KERNEL
288 #  include "rte_ma1_cb-rom.ld"
289 # else
290 #  include "rte_ma1_cb.ld"
291 # endif
292 #endif
293
294 #ifdef CONFIG_RTE_CB_NB85E
295 # ifdef CONFIG_ROM_KERNEL
296 #  include "rte_nb85e_cb-rom.ld"
297 # elif defined(CONFIG_RTE_CB_MULTI)
298 #  include "rte_nb85e_cb-multi.ld"
299 # else
300 #  include "rte_nb85e_cb.ld"
301 # endif
302 #endif
303
304 #ifdef CONFIG_RTE_CB_ME2
305 #  include "rte_me2_cb.ld"
306 #endif
307