blob: b7fe505e358d853e1d38d11b78826f1ee050169e [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 = . ;
Greg Ungerer9b0e7412008-07-11 15:29:36 +100065 HEAD_TEXT
Sam Ravnborg76647092007-05-13 00:31:33 +020066 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 SCHED_TEXT
Sebastian Siewior779125c2008-05-01 12:16:46 +100068 LOCK_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 *(.text.lock)
70
71 . = ALIGN(16); /* Exception table */
72 __start___ex_table = .;
73 *(__ex_table)
74 __stop___ex_table = .;
75
76 *(.rodata) *(.rodata.*)
77 *(__vermagic) /* Kernel version magic */
Sebastian Siewior779125c2008-05-01 12:16:46 +100078 *(__markers_strings)
Linus Torvalds1da177e2005-04-16 15:20:36 -070079 *(.rodata1)
80 *(.rodata.str1.1)
81
82 /* Kernel symbol table: Normal symbols */
83 . = ALIGN(4);
84 __start___ksymtab = .;
85 *(__ksymtab)
86 __stop___ksymtab = .;
87
88 /* Kernel symbol table: GPL-only symbols */
89 __start___ksymtab_gpl = .;
90 *(__ksymtab_gpl)
91 __stop___ksymtab_gpl = .;
92
Greg Ungerer56591b92007-02-07 11:45:43 +100093 /* Kernel symbol table: Normal unused symbols */
94 __start___ksymtab_unused = .;
95 *(__ksymtab_unused)
96 __stop___ksymtab_unused = .;
97
98 /* Kernel symbol table: GPL-only unused symbols */
99 __start___ksymtab_unused_gpl = .;
100 *(__ksymtab_unused_gpl)
101 __stop___ksymtab_unused_gpl = .;
102
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800103 /* Kernel symbol table: GPL-future symbols */
104 __start___ksymtab_gpl_future = .;
105 *(__ksymtab_gpl_future)
106 __stop___ksymtab_gpl_future = .;
107
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 /* Kernel symbol table: Normal symbols */
109 __start___kcrctab = .;
110 *(__kcrctab)
111 __stop___kcrctab = .;
112
113 /* Kernel symbol table: GPL-only symbols */
114 __start___kcrctab_gpl = .;
115 *(__kcrctab_gpl)
116 __stop___kcrctab_gpl = .;
117
Greg Ungererf38c8432008-05-12 14:02:23 -0700118 /* Kernel symbol table: Normal unused symbols */
119 __start___kcrctab_unused = .;
120 *(__kcrctab_unused)
121 __stop___kcrctab_unused = .;
122
123 /* Kernel symbol table: GPL-only unused symbols */
124 __start___kcrctab_unused_gpl = .;
125 *(__kcrctab_unused_gpl)
126 __stop___kcrctab_unused_gpl = .;
127
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800128 /* Kernel symbol table: GPL-future symbols */
129 __start___kcrctab_gpl_future = .;
130 *(__kcrctab_gpl_future)
131 __stop___kcrctab_gpl_future = .;
132
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 /* Kernel symbol table: strings */
134 *(__ksymtab_strings)
135
136 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000137 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138 __start___param = .;
139 *(__param)
140 __stop___param = .;
141
142 . = ALIGN(4) ;
143 _etext = . ;
144 } > TEXT
145
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 .data DATA_ADDR : {
147 . = ALIGN(4);
148 _sdata = . ;
Sam Ravnborgca967252007-05-17 13:38:44 +0200149 DATA_DATA
Greg Ungerera14f5e42009-04-17 22:55:06 +1000150 . = ALIGN(32);
151 *(.data.cacheline_aligned)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 . = ALIGN(8192) ;
153 *(.data.init_task)
154 _edata = . ;
155 } > DATA
156
157 .init : {
158 . = ALIGN(4096);
159 __init_begin = .;
160 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100161 INIT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162 _einittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100163 INIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164 . = ALIGN(16);
165 __setup_start = .;
166 *(.init.setup)
167 __setup_end = .;
168 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700169 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170 __initcall_end = .;
171 __con_initcall_start = .;
172 *(.con_initcall.init)
173 __con_initcall_end = .;
174 __security_initcall_start = .;
175 *(.security_initcall.init)
176 __security_initcall_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800177#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178 . = ALIGN(4);
179 __initramfs_start = .;
180 *(.init.ramfs)
181 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800182#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 . = ALIGN(4096);
184 __init_end = .;
185 } > INIT
186
187 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100188 EXIT_TEXT
189 EXIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190 *(.exitcall.exit)
191 }
192
193 .bss : {
194 . = ALIGN(4);
195 _sbss = . ;
196 *(.bss)
197 *(COMMON)
198 . = ALIGN(4) ;
199 _ebss = . ;
Sebastian Siewior779125c2008-05-01 12:16:46 +1000200 _end = . ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201 } > BSS
202
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203}
204