blob: 58afa8be604ea1f1f6ab308e3634ea258f63c4bc [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 : {
63 _stext = . ;
64 *(.text)
65 SCHED_TEXT
66 *(.text.lock)
67
68 . = ALIGN(16); /* Exception table */
69 __start___ex_table = .;
70 *(__ex_table)
71 __stop___ex_table = .;
72
73 *(.rodata) *(.rodata.*)
74 *(__vermagic) /* Kernel version magic */
75 *(.rodata1)
76 *(.rodata.str1.1)
77
78 /* Kernel symbol table: Normal symbols */
79 . = ALIGN(4);
80 __start___ksymtab = .;
81 *(__ksymtab)
82 __stop___ksymtab = .;
83
84 /* Kernel symbol table: GPL-only symbols */
85 __start___ksymtab_gpl = .;
86 *(__ksymtab_gpl)
87 __stop___ksymtab_gpl = .;
88
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -080089 /* Kernel symbol table: GPL-future symbols */
90 __start___ksymtab_gpl_future = .;
91 *(__ksymtab_gpl_future)
92 __stop___ksymtab_gpl_future = .;
93
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 /* Kernel symbol table: Normal symbols */
95 __start___kcrctab = .;
96 *(__kcrctab)
97 __stop___kcrctab = .;
98
99 /* Kernel symbol table: GPL-only symbols */
100 __start___kcrctab_gpl = .;
101 *(__kcrctab_gpl)
102 __stop___kcrctab_gpl = .;
103
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800104 /* Kernel symbol table: GPL-future symbols */
105 __start___kcrctab_gpl_future = .;
106 *(__kcrctab_gpl_future)
107 __stop___kcrctab_gpl_future = .;
108
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109 /* Kernel symbol table: strings */
110 *(__ksymtab_strings)
111
112 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000113 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 __start___param = .;
115 *(__param)
116 __stop___param = .;
117
118 . = ALIGN(4) ;
119 _etext = . ;
120 } > TEXT
121
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 .data DATA_ADDR : {
123 . = ALIGN(4);
124 _sdata = . ;
125 *(.data)
126 . = ALIGN(8192) ;
127 *(.data.init_task)
128 _edata = . ;
129 } > DATA
130
131 .init : {
132 . = ALIGN(4096);
133 __init_begin = .;
134 _sinittext = .;
135 *(.init.text)
136 _einittext = .;
137 *(.init.data)
138 . = ALIGN(16);
139 __setup_start = .;
140 *(.init.setup)
141 __setup_end = .;
142 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700143 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144 __initcall_end = .;
145 __con_initcall_start = .;
146 *(.con_initcall.init)
147 __con_initcall_end = .;
148 __security_initcall_start = .;
149 *(.security_initcall.init)
150 __security_initcall_end = .;
151 . = ALIGN(4);
152 __initramfs_start = .;
153 *(.init.ramfs)
154 __initramfs_end = .;
155 . = ALIGN(4096);
156 __init_end = .;
157 } > INIT
158
159 /DISCARD/ : {
160 *(.exit.text)
161 *(.exit.data)
162 *(.exitcall.exit)
163 }
164
165 .bss : {
166 . = ALIGN(4);
167 _sbss = . ;
168 *(.bss)
169 *(COMMON)
170 . = ALIGN(4) ;
171 _ebss = . ;
172 } > BSS
173
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174}
175