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