blob: 5592e0bf951f555f9efb18c55838215b80cc9db8 [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 Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800117 /* Kernel symbol table: GPL-future symbols */
118 __start___kcrctab_gpl_future = .;
119 *(__kcrctab_gpl_future)
120 __stop___kcrctab_gpl_future = .;
121
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 /* Kernel symbol table: strings */
123 *(__ksymtab_strings)
124
125 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000126 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127 __start___param = .;
128 *(__param)
129 __stop___param = .;
130
131 . = ALIGN(4) ;
132 _etext = . ;
133 } > TEXT
134
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135 .data DATA_ADDR : {
136 . = ALIGN(4);
137 _sdata = . ;
Sam Ravnborgca967252007-05-17 13:38:44 +0200138 DATA_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 . = ALIGN(8192) ;
140 *(.data.init_task)
141 _edata = . ;
142 } > DATA
143
144 .init : {
145 . = ALIGN(4096);
146 __init_begin = .;
147 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100148 INIT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 _einittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100150 INIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151 . = ALIGN(16);
152 __setup_start = .;
153 *(.init.setup)
154 __setup_end = .;
155 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700156 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157 __initcall_end = .;
158 __con_initcall_start = .;
159 *(.con_initcall.init)
160 __con_initcall_end = .;
161 __security_initcall_start = .;
162 *(.security_initcall.init)
163 __security_initcall_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800164#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 . = ALIGN(4);
166 __initramfs_start = .;
167 *(.init.ramfs)
168 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800169#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170 . = ALIGN(4096);
171 __init_end = .;
172 } > INIT
173
174 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100175 EXIT_TEXT
176 EXIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177 *(.exitcall.exit)
178 }
179
180 .bss : {
181 . = ALIGN(4);
182 _sbss = . ;
183 *(.bss)
184 *(COMMON)
185 . = ALIGN(4) ;
186 _ebss = . ;
Sebastian Siewior779125c2008-05-01 12:16:46 +1000187 _end = . ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 } > BSS
189
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190}
191