blob: 2b2a10da64a4b3af8e8daebaadc876314bc8fcd9 [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 *
Greg Ungerer1c952af2006-06-28 16:44:14 +10006 * This linker script is equiped to build either ROM loaded or RAM
7 * run kernels.
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 */
9
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <asm-generic/vmlinux.lds.h>
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#if defined(CONFIG_RAMKERNEL)
Greg Ungerer73e2fba2006-06-26 16:33:05 +100013#define RAM_START CONFIG_KERNELBASE
14#define RAM_LENGTH (CONFIG_RAMBASE + CONFIG_RAMSIZE - CONFIG_KERNELBASE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#define TEXT ram
16#define DATA ram
17#define INIT ram
18#define BSS ram
19#endif
20#if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
Greg Ungerer73e2fba2006-06-26 16:33:05 +100021#define RAM_START CONFIG_RAMBASE
22#define RAM_LENGTH CONFIG_RAMSIZE
Greg Ungerer1c952af2006-06-28 16:44:14 +100023#define ROMVEC_START CONFIG_ROMVEC
24#define ROMVEC_LENGTH CONFIG_ROMVECSIZE
25#define ROM_START CONFIG_ROMSTART
26#define ROM_LENGTH CONFIG_ROMSIZE
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#define TEXT rom
28#define DATA ram
29#define INIT ram
30#define BSS ram
31#endif
32
33#ifndef DATA_ADDR
34#define DATA_ADDR
35#endif
36
37
38OUTPUT_ARCH(m68k)
39ENTRY(_start)
40
41MEMORY {
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
Linus Torvalds1da177e2005-04-16 15:20:36 -070043#ifdef ROM_START
44 romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
45 rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#endif
47}
48
49jiffies = jiffies_64 + 4;
50
51SECTIONS {
52
53#ifdef ROMVEC_START
54 . = ROMVEC_START ;
55 .romvec : {
56 __rom_start = . ;
57 _romvec = .;
58 *(.data.initvect)
59 } > romvec
60#endif
61
62 .text : {
Eric W. Biedermanfd593d12006-12-07 02:14:04 +010063 _text = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 _stext = . ;
65 *(.text)
66 SCHED_TEXT
67 *(.text.lock)
68
69 . = ALIGN(16); /* Exception table */
70 __start___ex_table = .;
71 *(__ex_table)
72 __stop___ex_table = .;
73
74 *(.rodata) *(.rodata.*)
75 *(__vermagic) /* Kernel version magic */
76 *(.rodata1)
77 *(.rodata.str1.1)
78
79 /* Kernel symbol table: Normal symbols */
80 . = ALIGN(4);
81 __start___ksymtab = .;
82 *(__ksymtab)
83 __stop___ksymtab = .;
84
85 /* Kernel symbol table: GPL-only symbols */
86 __start___ksymtab_gpl = .;
87 *(__ksymtab_gpl)
88 __stop___ksymtab_gpl = .;
89
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -080090 /* Kernel symbol table: GPL-future symbols */
91 __start___ksymtab_gpl_future = .;
92 *(__ksymtab_gpl_future)
93 __stop___ksymtab_gpl_future = .;
94
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 /* Kernel symbol table: Normal symbols */
96 __start___kcrctab = .;
97 *(__kcrctab)
98 __stop___kcrctab = .;
99
100 /* Kernel symbol table: GPL-only symbols */
101 __start___kcrctab_gpl = .;
102 *(__kcrctab_gpl)
103 __stop___kcrctab_gpl = .;
104
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800105 /* Kernel symbol table: GPL-future symbols */
106 __start___kcrctab_gpl_future = .;
107 *(__kcrctab_gpl_future)
108 __stop___kcrctab_gpl_future = .;
109
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 /* Kernel symbol table: strings */
111 *(__ksymtab_strings)
112
113 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000114 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 __start___param = .;
116 *(__param)
117 __stop___param = .;
118
119 . = ALIGN(4) ;
120 _etext = . ;
121 } > TEXT
122
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 .data DATA_ADDR : {
124 . = ALIGN(4);
125 _sdata = . ;
126 *(.data)
127 . = ALIGN(8192) ;
128 *(.data.init_task)
129 _edata = . ;
130 } > DATA
131
132 .init : {
133 . = ALIGN(4096);
134 __init_begin = .;
135 _sinittext = .;
136 *(.init.text)
137 _einittext = .;
138 *(.init.data)
139 . = ALIGN(16);
140 __setup_start = .;
141 *(.init.setup)
142 __setup_end = .;
143 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700144 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 __initcall_end = .;
146 __con_initcall_start = .;
147 *(.con_initcall.init)
148 __con_initcall_end = .;
149 __security_initcall_start = .;
150 *(.security_initcall.init)
151 __security_initcall_end = .;
152 . = ALIGN(4);
153 __initramfs_start = .;
154 *(.init.ramfs)
155 __initramfs_end = .;
156 . = ALIGN(4096);
157 __init_end = .;
158 } > INIT
159
160 /DISCARD/ : {
161 *(.exit.text)
162 *(.exit.data)
163 *(.exitcall.exit)
164 }
165
166 .bss : {
167 . = ALIGN(4);
168 _sbss = . ;
169 *(.bss)
170 *(COMMON)
171 . = ALIGN(4) ;
172 _ebss = . ;
173 } > BSS
174
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175}
176