blob: 6a2f0c6932547079639ebf10ff11955660ad5a3e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * vmlinux.lds.S -- master linker script for m68knommu arch
3 *
Greg Ungerer73e2fba2006-06-26 16:33:05 +10004 * (C) Copyright 2002-2006, Greg Ungerer <gerg@snapgear.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 *
6 * This ends up looking compilcated, because of the number of
7 * address variations for ram and rom/flash layouts. The real
8 * work of the linker script is all at the end, and reasonably
9 * strait forward.
10 */
11
12#include <linux/config.h>
13#include <asm-generic/vmlinux.lds.h>
14
15/*
16 * Original Palm pilot (same for Xcopilot).
17 * There is really only a rom target for this.
18 */
19#ifdef CONFIG_PILOT3
20#define ROMVEC_START 0x10c00000
21#define ROMVEC_LENGTH 0x10400
22#define ROM_START 0x10c10400
23#define ROM_LENGTH 0xfec00
24#define ROM_END 0x10d00000
Greg Ungerer73e2fba2006-06-26 16:33:05 +100025#define DATA_ADDR CONFIG_KERNELBASE
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#endif
27
28/*
29 * Same setup on both the uCsimm and uCdimm.
30 */
31#if defined(CONFIG_UCSIMM) || defined(CONFIG_UCDIMM)
32#ifdef CONFIG_RAMKERNEL
33#define ROMVEC_START 0x10c10000
34#define ROMVEC_LENGTH 0x400
35#define ROM_START 0x10c10400
36#define ROM_LENGTH 0x1efc00
37#define ROM_END 0x10e00000
Linus Torvalds1da177e2005-04-16 15:20:36 -070038#endif
39#ifdef CONFIG_ROMKERNEL
40#define ROMVEC_START 0x10c10000
41#define ROMVEC_LENGTH 0x400
42#define ROM_START 0x10c10400
43#define ROM_LENGTH 0x1efc00
44#define ROM_END 0x10e00000
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#endif
46#ifdef CONFIG_HIMEMKERNEL
47#define ROMVEC_START 0x00600000
48#define ROMVEC_LENGTH 0x400
49#define ROM_START 0x00600400
50#define ROM_LENGTH 0x1efc00
51#define ROM_END 0x007f0000
Linus Torvalds1da177e2005-04-16 15:20:36 -070052#endif
53#endif
54
Linus Torvalds1da177e2005-04-16 15:20:36 -070055#ifdef CONFIG_UCQUICC
56#define ROMVEC_START 0x00000000
57#define ROMVEC_LENGTH 0x404
58#define ROM_START 0x00000404
59#define ROM_LENGTH 0x1ff6fc
60#define ROM_END 0x00200000
Greg Ungerer4945b302005-09-02 10:42:52 +100061#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
63#if defined(CONFIG_RAMKERNEL)
Greg Ungerer73e2fba2006-06-26 16:33:05 +100064#define RAM_START CONFIG_KERNELBASE
65#define RAM_LENGTH (CONFIG_RAMBASE + CONFIG_RAMSIZE - CONFIG_KERNELBASE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070066#define TEXT ram
67#define DATA ram
68#define INIT ram
69#define BSS ram
70#endif
71#if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
Greg Ungerer73e2fba2006-06-26 16:33:05 +100072#define RAM_START CONFIG_RAMBASE
73#define RAM_LENGTH CONFIG_RAMSIZE
Linus Torvalds1da177e2005-04-16 15:20:36 -070074#define TEXT rom
75#define DATA ram
76#define INIT ram
77#define BSS ram
78#endif
79
80#ifndef DATA_ADDR
81#define DATA_ADDR
82#endif
83
84
85OUTPUT_ARCH(m68k)
86ENTRY(_start)
87
88MEMORY {
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
Linus Torvalds1da177e2005-04-16 15:20:36 -070090#ifdef ROM_START
91 romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
92 rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
93 erom : ORIGIN = ROM_END, LENGTH = 0
94#endif
95}
96
97jiffies = jiffies_64 + 4;
98
99SECTIONS {
100
101#ifdef ROMVEC_START
102 . = ROMVEC_START ;
103 .romvec : {
104 __rom_start = . ;
105 _romvec = .;
106 *(.data.initvect)
107 } > romvec
108#endif
109
110 .text : {
111 _stext = . ;
112 *(.text)
113 SCHED_TEXT
114 *(.text.lock)
115
116 . = ALIGN(16); /* Exception table */
117 __start___ex_table = .;
118 *(__ex_table)
119 __stop___ex_table = .;
120
121 *(.rodata) *(.rodata.*)
122 *(__vermagic) /* Kernel version magic */
123 *(.rodata1)
124 *(.rodata.str1.1)
125
126 /* Kernel symbol table: Normal symbols */
127 . = ALIGN(4);
128 __start___ksymtab = .;
129 *(__ksymtab)
130 __stop___ksymtab = .;
131
132 /* Kernel symbol table: GPL-only symbols */
133 __start___ksymtab_gpl = .;
134 *(__ksymtab_gpl)
135 __stop___ksymtab_gpl = .;
136
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800137 /* Kernel symbol table: GPL-future symbols */
138 __start___ksymtab_gpl_future = .;
139 *(__ksymtab_gpl_future)
140 __stop___ksymtab_gpl_future = .;
141
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 /* Kernel symbol table: Normal symbols */
143 __start___kcrctab = .;
144 *(__kcrctab)
145 __stop___kcrctab = .;
146
147 /* Kernel symbol table: GPL-only symbols */
148 __start___kcrctab_gpl = .;
149 *(__kcrctab_gpl)
150 __stop___kcrctab_gpl = .;
151
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800152 /* Kernel symbol table: GPL-future symbols */
153 __start___kcrctab_gpl_future = .;
154 *(__kcrctab_gpl_future)
155 __stop___kcrctab_gpl_future = .;
156
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157 /* Kernel symbol table: strings */
158 *(__ksymtab_strings)
159
160 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000161 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162 __start___param = .;
163 *(__param)
164 __stop___param = .;
165
166 . = ALIGN(4) ;
167 _etext = . ;
168 } > TEXT
169
170#ifdef ROM_END
171 . = ROM_END ;
172 .erom : {
173 __rom_end = . ;
174 } > erom
175#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176
177 .data DATA_ADDR : {
178 . = ALIGN(4);
179 _sdata = . ;
180 *(.data)
181 . = ALIGN(8192) ;
182 *(.data.init_task)
183 _edata = . ;
184 } > DATA
185
186 .init : {
187 . = ALIGN(4096);
188 __init_begin = .;
189 _sinittext = .;
190 *(.init.text)
191 _einittext = .;
192 *(.init.data)
193 . = ALIGN(16);
194 __setup_start = .;
195 *(.init.setup)
196 __setup_end = .;
197 __initcall_start = .;
198 *(.initcall1.init)
199 *(.initcall2.init)
200 *(.initcall3.init)
201 *(.initcall4.init)
202 *(.initcall5.init)
203 *(.initcall6.init)
204 *(.initcall7.init)
205 __initcall_end = .;
206 __con_initcall_start = .;
207 *(.con_initcall.init)
208 __con_initcall_end = .;
209 __security_initcall_start = .;
210 *(.security_initcall.init)
211 __security_initcall_end = .;
212 . = ALIGN(4);
213 __initramfs_start = .;
214 *(.init.ramfs)
215 __initramfs_end = .;
216 . = ALIGN(4096);
217 __init_end = .;
218 } > INIT
219
220 /DISCARD/ : {
221 *(.exit.text)
222 *(.exit.data)
223 *(.exitcall.exit)
224 }
225
226 .bss : {
227 . = ALIGN(4);
228 _sbss = . ;
229 *(.bss)
230 *(COMMON)
231 . = ALIGN(4) ;
232 _ebss = . ;
233 } > BSS
234
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235}
236