blob: d6c814e4055b4340886d3f1becccd002f7f44324 [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>
Tim Abbottf4bed4f2009-10-18 13:23:49 -040011#include <asm/page.h>
Tim Abbott49612a52009-10-18 13:23:51 -040012#include <asm/thread_info.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#if defined(CONFIG_RAMKERNEL)
Greg Ungerer73e2fba2006-06-26 16:33:05 +100015#define RAM_START CONFIG_KERNELBASE
16#define RAM_LENGTH (CONFIG_RAMBASE + CONFIG_RAMSIZE - CONFIG_KERNELBASE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#define TEXT ram
18#define DATA ram
19#define INIT ram
Greg Ungerer10f204e2009-10-30 14:58:58 +100020#define BSSS ram
Linus Torvalds1da177e2005-04-16 15:20:36 -070021#endif
22#if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
Greg Ungerer73e2fba2006-06-26 16:33:05 +100023#define RAM_START CONFIG_RAMBASE
24#define RAM_LENGTH CONFIG_RAMSIZE
Greg Ungerer1c952af2006-06-28 16:44:14 +100025#define ROMVEC_START CONFIG_ROMVEC
26#define ROMVEC_LENGTH CONFIG_ROMVECSIZE
27#define ROM_START CONFIG_ROMSTART
28#define ROM_LENGTH CONFIG_ROMSIZE
Linus Torvalds1da177e2005-04-16 15:20:36 -070029#define TEXT rom
30#define DATA ram
31#define INIT ram
Greg Ungerer10f204e2009-10-30 14:58:58 +100032#define BSSS ram
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#endif
34
35#ifndef DATA_ADDR
36#define DATA_ADDR
37#endif
38
39
40OUTPUT_ARCH(m68k)
41ENTRY(_start)
42
43MEMORY {
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#ifdef ROM_START
46 romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
47 rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#endif
49}
50
51jiffies = jiffies_64 + 4;
52
53SECTIONS {
54
55#ifdef ROMVEC_START
56 . = ROMVEC_START ;
57 .romvec : {
58 __rom_start = . ;
59 _romvec = .;
60 *(.data.initvect)
61 } > romvec
62#endif
63
64 .text : {
Eric W. Biedermanfd593d12006-12-07 02:14:04 +010065 _text = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 _stext = . ;
Greg Ungerer9b0e7412008-07-11 15:29:36 +100067 HEAD_TEXT
Sam Ravnborg76647092007-05-13 00:31:33 +020068 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 SCHED_TEXT
Sebastian Siewior779125c2008-05-01 12:16:46 +100070 LOCK_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 *(.text.lock)
72
73 . = ALIGN(16); /* Exception table */
74 __start___ex_table = .;
75 *(__ex_table)
76 __stop___ex_table = .;
77
78 *(.rodata) *(.rodata.*)
79 *(__vermagic) /* Kernel version magic */
Sebastian Siewior779125c2008-05-01 12:16:46 +100080 *(__markers_strings)
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 *(.rodata1)
82 *(.rodata.str1.1)
83
84 /* Kernel symbol table: Normal symbols */
85 . = ALIGN(4);
86 __start___ksymtab = .;
87 *(__ksymtab)
88 __stop___ksymtab = .;
89
90 /* Kernel symbol table: GPL-only symbols */
91 __start___ksymtab_gpl = .;
92 *(__ksymtab_gpl)
93 __stop___ksymtab_gpl = .;
94
Greg Ungerer56591b92007-02-07 11:45:43 +100095 /* Kernel symbol table: Normal unused symbols */
96 __start___ksymtab_unused = .;
97 *(__ksymtab_unused)
98 __stop___ksymtab_unused = .;
99
100 /* Kernel symbol table: GPL-only unused symbols */
101 __start___ksymtab_unused_gpl = .;
102 *(__ksymtab_unused_gpl)
103 __stop___ksymtab_unused_gpl = .;
104
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800105 /* Kernel symbol table: GPL-future symbols */
106 __start___ksymtab_gpl_future = .;
107 *(__ksymtab_gpl_future)
108 __stop___ksymtab_gpl_future = .;
109
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 /* Kernel symbol table: Normal symbols */
111 __start___kcrctab = .;
112 *(__kcrctab)
113 __stop___kcrctab = .;
114
115 /* Kernel symbol table: GPL-only symbols */
116 __start___kcrctab_gpl = .;
117 *(__kcrctab_gpl)
118 __stop___kcrctab_gpl = .;
119
Greg Ungererf38c8432008-05-12 14:02:23 -0700120 /* Kernel symbol table: Normal unused symbols */
121 __start___kcrctab_unused = .;
122 *(__kcrctab_unused)
123 __stop___kcrctab_unused = .;
124
125 /* Kernel symbol table: GPL-only unused symbols */
126 __start___kcrctab_unused_gpl = .;
127 *(__kcrctab_unused_gpl)
128 __stop___kcrctab_unused_gpl = .;
129
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800130 /* Kernel symbol table: GPL-future symbols */
131 __start___kcrctab_gpl_future = .;
132 *(__kcrctab_gpl_future)
133 __stop___kcrctab_gpl_future = .;
134
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135 /* Kernel symbol table: strings */
136 *(__ksymtab_strings)
137
138 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000139 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140 __start___param = .;
141 *(__param)
142 __stop___param = .;
143
144 . = ALIGN(4) ;
145 _etext = . ;
146 } > TEXT
147
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 .data DATA_ADDR : {
149 . = ALIGN(4);
150 _sdata = . ;
Sam Ravnborgca967252007-05-17 13:38:44 +0200151 DATA_DATA
Tim Abbott49612a52009-10-18 13:23:51 -0400152 CACHELINE_ALIGNED_DATA(32)
153 INIT_TASK_DATA(THREAD_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154 _edata = . ;
155 } > DATA
156
157 .init : {
Tim Abbottf4bed4f2009-10-18 13:23:49 -0400158 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159 __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
Tim Abbottf4bed4f2009-10-18 13:23:49 -0400183 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184 __init_end = .;
185 } > INIT
186
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187 .bss : {
188 . = ALIGN(4);
189 _sbss = . ;
190 *(.bss)
191 *(COMMON)
192 . = ALIGN(4) ;
193 _ebss = . ;
Sebastian Siewior779125c2008-05-01 12:16:46 +1000194 _end = . ;
Greg Ungerer10f204e2009-10-30 14:58:58 +1000195 } > BSSS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196
Tejun Heo023bf6f2009-07-09 11:27:40 +0900197 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198}
199