blob: 8e66ccb0935ee5c408e17c4614b66397cc1dbbdf [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 *
Lucas De Marchi25985ed2011-03-30 22:57:33 -03006 * This linker script is equipped to build either ROM loaded or RAM
Greg Ungerer1c952af2006-06-28 16:44:14 +10007 * 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 = .;
Denys Vlasenko2c31c342010-02-20 01:03:54 +010060 *(.data..initvect)
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 } > 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
Denys Vlasenko75ddb0e2010-02-20 01:03:48 +010071 *(.text..lock)
Greg Ungerered865e32011-10-19 13:50:35 +100072 *(.fixup)
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
74 . = ALIGN(16); /* Exception table */
75 __start___ex_table = .;
76 *(__ex_table)
77 __stop___ex_table = .;
78
79 *(.rodata) *(.rodata.*)
80 *(__vermagic) /* Kernel version magic */
81 *(.rodata1)
82 *(.rodata.str1.1)
83
84 /* Kernel symbol table: Normal symbols */
85 . = ALIGN(4);
86 __start___ksymtab = .;
Greg Ungererdab104a2011-06-02 14:09:32 +100087 *(SORT(___ksymtab+*))
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 __stop___ksymtab = .;
89
90 /* Kernel symbol table: GPL-only symbols */
91 __start___ksymtab_gpl = .;
Greg Ungererdab104a2011-06-02 14:09:32 +100092 *(SORT(___ksymtab_gpl+*))
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 __stop___ksymtab_gpl = .;
94
Greg Ungerer56591b92007-02-07 11:45:43 +100095 /* Kernel symbol table: Normal unused symbols */
96 __start___ksymtab_unused = .;
Greg Ungererdab104a2011-06-02 14:09:32 +100097 *(SORT(___ksymtab_unused+*))
Greg Ungerer56591b92007-02-07 11:45:43 +100098 __stop___ksymtab_unused = .;
99
100 /* Kernel symbol table: GPL-only unused symbols */
101 __start___ksymtab_unused_gpl = .;
Greg Ungererdab104a2011-06-02 14:09:32 +1000102 *(SORT(___ksymtab_unused_gpl+*))
Greg Ungerer56591b92007-02-07 11:45:43 +1000103 __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 = .;
Greg Ungererdab104a2011-06-02 14:09:32 +1000107 *(SORT(___ksymtab_gpl_future+*))
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800108 __stop___ksymtab_gpl_future = .;
109
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 /* Kernel symbol table: Normal symbols */
111 __start___kcrctab = .;
Greg Ungererdab104a2011-06-02 14:09:32 +1000112 *(SORT(___kcrctab+*))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 __stop___kcrctab = .;
114
115 /* Kernel symbol table: GPL-only symbols */
116 __start___kcrctab_gpl = .;
Greg Ungererdab104a2011-06-02 14:09:32 +1000117 *(SORT(___kcrctab_gpl+*))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 __stop___kcrctab_gpl = .;
119
Greg Ungererf38c8432008-05-12 14:02:23 -0700120 /* Kernel symbol table: Normal unused symbols */
121 __start___kcrctab_unused = .;
Greg Ungererdab104a2011-06-02 14:09:32 +1000122 *(SORT(___kcrctab_unused+*))
Greg Ungererf38c8432008-05-12 14:02:23 -0700123 __stop___kcrctab_unused = .;
124
125 /* Kernel symbol table: GPL-only unused symbols */
126 __start___kcrctab_unused_gpl = .;
Greg Ungererdab104a2011-06-02 14:09:32 +1000127 *(SORT(___kcrctab_unused_gpl+*))
Greg Ungererf38c8432008-05-12 14:02:23 -0700128 __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 = .;
Greg Ungererdab104a2011-06-02 14:09:32 +1000132 *(SORT(___kcrctab_gpl_future+*))
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800133 __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
Greg Ungerer81174262011-02-08 14:45:59 +1000144 /* Built-in module versions */
145 . = ALIGN(4) ;
146 __start___modver = .;
147 *(__modver)
148 __stop___modver = .;
149
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150 . = ALIGN(4) ;
151 _etext = . ;
152 } > TEXT
153
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154 .data DATA_ADDR : {
155 . = ALIGN(4);
156 _sdata = . ;
Sam Ravnborgca967252007-05-17 13:38:44 +0200157 DATA_DATA
Tim Abbott49612a52009-10-18 13:23:51 -0400158 CACHELINE_ALIGNED_DATA(32)
Greg Ungerere6ba59b2010-09-03 11:15:19 +1000159 PAGE_ALIGNED_DATA(PAGE_SIZE)
160 *(.data..shared_aligned)
Tim Abbott49612a52009-10-18 13:23:51 -0400161 INIT_TASK_DATA(THREAD_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162 _edata = . ;
163 } > DATA
164
Greg Ungerered865e32011-10-19 13:50:35 +1000165 .m68k_fixup : {
166 __start_fixup = .;
167 *(.m68k_fixup)
168 __stop_fixup = .;
169 } > DATA
170 NOTES > DATA
171
Tim Abbott53749f72009-10-18 13:23:55 -0400172 .init.text : {
Tim Abbottf4bed4f2009-10-18 13:23:49 -0400173 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174 __init_begin = .;
Tim Abbotta90a44e2009-10-18 13:23:53 -0400175 } > INIT
Tim Abbott53749f72009-10-18 13:23:55 -0400176 INIT_TEXT_SECTION(PAGE_SIZE) > INIT
177 INIT_DATA_SECTION(16) > INIT
178 .init.data : {
Tim Abbottf4bed4f2009-10-18 13:23:49 -0400179 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180 __init_end = .;
181 } > INIT
182
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 .bss : {
184 . = ALIGN(4);
185 _sbss = . ;
186 *(.bss)
187 *(COMMON)
188 . = ALIGN(4) ;
189 _ebss = . ;
Sebastian Siewior779125c2008-05-01 12:16:46 +1000190 _end = . ;
Greg Ungerer10f204e2009-10-30 14:58:58 +1000191 } > BSSS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192
Tejun Heo023bf6f2009-07-09 11:27:40 +0900193 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194}
195