blob: 93e69236ed6f8bfd1b6b38408aa380fc43d247de [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
Sebastian Siewior779125c2008-05-01 12:16:46 +100067 LOCK_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 *(.text.lock)
69
70 . = ALIGN(16); /* Exception table */
71 __start___ex_table = .;
72 *(__ex_table)
73 __stop___ex_table = .;
74
75 *(.rodata) *(.rodata.*)
76 *(__vermagic) /* Kernel version magic */
Sebastian Siewior779125c2008-05-01 12:16:46 +100077 *(__markers_strings)
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 *(.rodata1)
79 *(.rodata.str1.1)
80
81 /* Kernel symbol table: Normal symbols */
82 . = ALIGN(4);
83 __start___ksymtab = .;
84 *(__ksymtab)
85 __stop___ksymtab = .;
86
87 /* Kernel symbol table: GPL-only symbols */
88 __start___ksymtab_gpl = .;
89 *(__ksymtab_gpl)
90 __stop___ksymtab_gpl = .;
91
Greg Ungerer56591b92007-02-07 11:45:43 +100092 /* Kernel symbol table: Normal unused symbols */
93 __start___ksymtab_unused = .;
94 *(__ksymtab_unused)
95 __stop___ksymtab_unused = .;
96
97 /* Kernel symbol table: GPL-only unused symbols */
98 __start___ksymtab_unused_gpl = .;
99 *(__ksymtab_unused_gpl)
100 __stop___ksymtab_unused_gpl = .;
101
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800102 /* Kernel symbol table: GPL-future symbols */
103 __start___ksymtab_gpl_future = .;
104 *(__ksymtab_gpl_future)
105 __stop___ksymtab_gpl_future = .;
106
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107 /* Kernel symbol table: Normal symbols */
108 __start___kcrctab = .;
109 *(__kcrctab)
110 __stop___kcrctab = .;
111
112 /* Kernel symbol table: GPL-only symbols */
113 __start___kcrctab_gpl = .;
114 *(__kcrctab_gpl)
115 __stop___kcrctab_gpl = .;
116
Greg Ungererf38c8432008-05-12 14:02:23 -0700117 /* Kernel symbol table: Normal unused symbols */
118 __start___kcrctab_unused = .;
119 *(__kcrctab_unused)
120 __stop___kcrctab_unused = .;
121
122 /* Kernel symbol table: GPL-only unused symbols */
123 __start___kcrctab_unused_gpl = .;
124 *(__kcrctab_unused_gpl)
125 __stop___kcrctab_unused_gpl = .;
126
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800127 /* Kernel symbol table: GPL-future symbols */
128 __start___kcrctab_gpl_future = .;
129 *(__kcrctab_gpl_future)
130 __stop___kcrctab_gpl_future = .;
131
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132 /* Kernel symbol table: strings */
133 *(__ksymtab_strings)
134
135 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000136 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137 __start___param = .;
138 *(__param)
139 __stop___param = .;
140
141 . = ALIGN(4) ;
142 _etext = . ;
143 } > TEXT
144
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 .data DATA_ADDR : {
146 . = ALIGN(4);
147 _sdata = . ;
Sam Ravnborgca967252007-05-17 13:38:44 +0200148 DATA_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 . = ALIGN(8192) ;
150 *(.data.init_task)
151 _edata = . ;
152 } > DATA
153
154 .init : {
155 . = ALIGN(4096);
156 __init_begin = .;
157 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100158 INIT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159 _einittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100160 INIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161 . = ALIGN(16);
162 __setup_start = .;
163 *(.init.setup)
164 __setup_end = .;
165 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700166 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167 __initcall_end = .;
168 __con_initcall_start = .;
169 *(.con_initcall.init)
170 __con_initcall_end = .;
171 __security_initcall_start = .;
172 *(.security_initcall.init)
173 __security_initcall_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800174#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 . = ALIGN(4);
176 __initramfs_start = .;
177 *(.init.ramfs)
178 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800179#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180 . = ALIGN(4096);
181 __init_end = .;
182 } > INIT
183
184 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100185 EXIT_TEXT
186 EXIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187 *(.exitcall.exit)
188 }
189
190 .bss : {
191 . = ALIGN(4);
192 _sbss = . ;
193 *(.bss)
194 *(COMMON)
195 . = ALIGN(4) ;
196 _ebss = . ;
Sebastian Siewior779125c2008-05-01 12:16:46 +1000197 _end = . ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198 } > BSS
199
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200}
201