]> err.no Git - linux-2.6/blob - arch/v850/kernel/vmlinux.lds.S
d08cd1d27f27a77cfdf5375bd14d54534acf27ea
[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                 _text = .;                                                    \
94                 __stext = . ;                                                 \
95                 TEXT_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 = . ;
112
113 /* Kernel data segment.  */
114 #define DATA_CONTENTS                                                         \
115                 __sdata = . ;                                                 \
116                 DATA_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 = . ;
125
126 /* Kernel BSS segment.  */
127 #define BSS_CONTENTS                                                          \
128                 __sbss = . ;                                                  \
129                         *(.bss)                                               \
130                         *(COMMON)                                             \
131                 . = ALIGN (4) ;                                               \
132                 __init_stack_end = . ;                                        \
133                 __ebss = . ;
134
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                         INITCALLS                                             \
145                 . = ALIGN (4) ;                                               \
146                 ___initcall_end = . ;                                         \
147                 ___con_initcall_start = .;                                    \
148                         *(.con_initcall.init)                                 \
149                 ___con_initcall_end = .;
150
151 /* Contents of `init' section for a kernel that's loaded into RAM.  */
152 #define RAMK_INIT_CONTENTS                                                    \
153                 RAMK_INIT_CONTENTS_NO_END                                     \
154                 __init_end = . ;
155 /* Same as RAMK_INIT_CONTENTS, but doesn't define the `__init_end' symbol.  */
156 #define RAMK_INIT_CONTENTS_NO_END                                             \
157                 . = ALIGN (4096) ;                                            \
158                 __init_start = . ;                                            \
159                         __sinittext = .;                                      \
160                         INIT_TEXT       /* 2.5 convention */                  \
161                         __einittext = .;                                      \
162                         INIT_DATA                                             \
163                         *(.text.init)   /* 2.4 convention */                  \
164                         *(.data.init)                                         \
165                 INITCALL_CONTENTS                                             \
166                 INITRAMFS_CONTENTS
167
168 /* The contents of `init' section for a ROM-resident kernel which
169    should go into RAM.  */      
170 #define ROMK_INIT_RAM_CONTENTS                                                \
171                 . = ALIGN (4096) ;                                            \
172                 __init_start = . ;                                            \
173                         INIT_DATA       /* 2.5 convention */                  \
174                         *(.data.init)   /* 2.4 convention */                  \
175                 __init_end = . ;                                              \
176                 . = ALIGN (4096) ;
177
178 /* The contents of `init' section for a ROM-resident kernel which
179    should go into ROM.  */      
180 #define ROMK_INIT_ROM_CONTENTS                                                \
181                         _sinittext = .;                                       \
182                         INIT_TEXT       /* 2.5 convention */                  \
183                         _einittext = .;                                       \
184                         *(.text.init)   /* 2.4 convention */                  \
185                 INITCALL_CONTENTS                                             \
186                 INITRAMFS_CONTENTS
187
188 /* A root filesystem image, for kernels with an embedded root filesystem.  */
189 #define ROOT_FS_CONTENTS                                                      \
190                 __root_fs_image_start = . ;                                   \
191                 *(.root)                                                      \
192                 __root_fs_image_end = . ;
193
194 #ifdef CONFIG_BLK_DEV_INITRD
195 /* The initramfs archive.  */
196 #define INITRAMFS_CONTENTS                                                    \
197                 . = ALIGN (4) ;                                               \
198                 ___initramfs_start = . ;                                      \
199                         *(.init.ramfs)                                        \
200                 ___initramfs_end = . ;
201 #endif
202
203 /* Where the initial bootmap (bitmap for the boot-time memory allocator) 
204    should be place.  */
205 #define BOOTMAP_CONTENTS                                                      \
206                 . = ALIGN (4096) ;                                            \
207                 __bootmap = . ;                                               \
208                 . = . + 4096 ;          /* enough for 128MB.   */
209
210 /* The contents of a `typical' kram area for a kernel in RAM.  */
211 #define RAMK_KRAM_CONTENTS                                                    \
212                 __kram_start = . ;                                            \
213                 TEXT_CONTENTS                                                 \
214                 DATA_CONTENTS                                                 \
215                 BSS_CONTENTS                                                  \
216                 RAMK_INIT_CONTENTS                                            \
217                 __kram_end = . ;                                              \
218                 BOOTMAP_CONTENTS
219
220
221 /* Define output sections normally used for a ROM-resident kernel.  
222    ROM and RAM should be appropriate memory areas to use for kernel
223    ROM and RAM data.  This assumes that ROM starts at 0 (and thus can
224    hold the interrupt vectors).  */
225 #define ROMK_SECTIONS(ROM, RAM)                                               \
226         .rom : {                                                              \
227                 INTV_CONTENTS                                                 \
228                 TEXT_CONTENTS                                                 \
229                 ROMK_INIT_ROM_CONTENTS                                        \
230                 ROOT_FS_CONTENTS                                              \
231         } > ROM                                                               \
232                                                                               \
233         __rom_copy_src_start = . ;                                            \
234                                                                               \
235         .data : {                                                             \
236                 __kram_start = . ;                                            \
237                 __rom_copy_dst_start = . ;                                    \
238                 DATA_CONTENTS                                                 \
239                 ROMK_INIT_RAM_CONTENTS                                        \
240                 __rom_copy_dst_end = . ;                                      \
241         } > RAM  AT> ROM                                                      \
242                                                                               \
243         .bss ALIGN (4) : {                                                    \
244                 BSS_CONTENTS                                                  \
245                 __kram_end = . ;                                              \
246                 BOOTMAP_CONTENTS                                              \
247         } > RAM
248
249
250 /* The 32-bit variable `jiffies' is just the lower 32-bits of `jiffies_64'.  */
251 _jiffies = _jiffies_64 ;
252
253
254 /* Include an appropriate platform-dependent linker-script (which
255    usually should use the above macros to do most of the work).  */
256
257 #ifdef CONFIG_V850E_SIM
258 # include "sim.ld"
259 #endif
260
261 #ifdef CONFIG_V850E2_SIM85E2
262 # include "sim85e2.ld"
263 #endif
264
265 #ifdef CONFIG_V850E2_FPGA85E2C
266 # include "fpga85e2c.ld"
267 #endif
268
269 #ifdef CONFIG_V850E2_ANNA
270 # ifdef CONFIG_ROM_KERNEL
271 #  include "anna-rom.ld"
272 # else
273 #  include "anna.ld"
274 # endif
275 #endif
276
277 #ifdef CONFIG_V850E_AS85EP1
278 # ifdef CONFIG_ROM_KERNEL
279 #  include "as85ep1-rom.ld"
280 # else
281 #  include "as85ep1.ld"
282 # endif
283 #endif
284
285 #ifdef CONFIG_RTE_CB_MA1
286 # ifdef CONFIG_ROM_KERNEL
287 #  include "rte_ma1_cb-rom.ld"
288 # else
289 #  include "rte_ma1_cb.ld"
290 # endif
291 #endif
292
293 #ifdef CONFIG_RTE_CB_NB85E
294 # ifdef CONFIG_ROM_KERNEL
295 #  include "rte_nb85e_cb-rom.ld"
296 # elif defined(CONFIG_RTE_CB_MULTI)
297 #  include "rte_nb85e_cb-multi.ld"
298 # else
299 #  include "rte_nb85e_cb.ld"
300 # endif
301 #endif
302
303 #ifdef CONFIG_RTE_CB_ME2
304 #  include "rte_me2_cb.ld"
305 #endif
306