blob: b44edb08e21276f3dce89e8b938c4e6a5252596c [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 = . ;
Sam Ravnborg76647092007-05-13 00:31:33 +020065 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 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 Ungerer56591b92007-02-07 11:45:43 +100090 /* Kernel symbol table: Normal unused symbols */
91 __start___ksymtab_unused = .;
92 *(__ksymtab_unused)
93 __stop___ksymtab_unused = .;
94
95 /* Kernel symbol table: GPL-only unused symbols */
96 __start___ksymtab_unused_gpl = .;
97 *(__ksymtab_unused_gpl)
98 __stop___ksymtab_unused_gpl = .;
99
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800100 /* Kernel symbol table: GPL-future symbols */
101 __start___ksymtab_gpl_future = .;
102 *(__ksymtab_gpl_future)
103 __stop___ksymtab_gpl_future = .;
104
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 /* Kernel symbol table: Normal symbols */
106 __start___kcrctab = .;
107 *(__kcrctab)
108 __stop___kcrctab = .;
109
110 /* Kernel symbol table: GPL-only symbols */
111 __start___kcrctab_gpl = .;
112 *(__kcrctab_gpl)
113 __stop___kcrctab_gpl = .;
114
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800115 /* Kernel symbol table: GPL-future symbols */
116 __start___kcrctab_gpl_future = .;
117 *(__kcrctab_gpl_future)
118 __stop___kcrctab_gpl_future = .;
119
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 /* Kernel symbol table: strings */
121 *(__ksymtab_strings)
122
123 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000124 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 __start___param = .;
126 *(__param)
127 __stop___param = .;
128
129 . = ALIGN(4) ;
130 _etext = . ;
131 } > TEXT
132
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 .data DATA_ADDR : {
134 . = ALIGN(4);
135 _sdata = . ;
Sam Ravnborgca967252007-05-17 13:38:44 +0200136 DATA_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137 . = ALIGN(8192) ;
138 *(.data.init_task)
139 _edata = . ;
140 } > DATA
141
142 .init : {
143 . = ALIGN(4096);
144 __init_begin = .;
145 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100146 INIT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 _einittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100148 INIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 . = ALIGN(16);
150 __setup_start = .;
151 *(.init.setup)
152 __setup_end = .;
153 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700154 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155 __initcall_end = .;
156 __con_initcall_start = .;
157 *(.con_initcall.init)
158 __con_initcall_end = .;
159 __security_initcall_start = .;
160 *(.security_initcall.init)
161 __security_initcall_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800162#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 . = ALIGN(4);
164 __initramfs_start = .;
165 *(.init.ramfs)
166 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800167#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168 . = ALIGN(4096);
169 __init_end = .;
170 } > INIT
171
172 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100173 EXIT_TEXT
174 EXIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 *(.exitcall.exit)
176 }
177
178 .bss : {
179 . = ALIGN(4);
180 _sbss = . ;
181 *(.bss)
182 *(COMMON)
183 . = ALIGN(4) ;
184 _ebss = . ;
185 } > BSS
186
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187}
188