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