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