blob: a91b2713451da0e5290a3889e1bcebbb530c0e4b [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 = .;
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)
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
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
Tim Abbott53749f72009-10-18 13:23:55 -0400157 .init.text : {
Tim Abbottf4bed4f2009-10-18 13:23:49 -0400158 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159 __init_begin = .;
Tim Abbotta90a44e2009-10-18 13:23:53 -0400160 } > INIT
Tim Abbott53749f72009-10-18 13:23:55 -0400161 INIT_TEXT_SECTION(PAGE_SIZE) > INIT
162 INIT_DATA_SECTION(16) > INIT
163 .init.data : {
Tim Abbottf4bed4f2009-10-18 13:23:49 -0400164 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 __init_end = .;
166 } > INIT
167
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168 .bss : {
169 . = ALIGN(4);
170 _sbss = . ;
171 *(.bss)
172 *(COMMON)
173 . = ALIGN(4) ;
174 _ebss = . ;
Sebastian Siewior779125c2008-05-01 12:16:46 +1000175 _end = . ;
Greg Ungerer10f204e2009-10-30 14:58:58 +1000176 } > BSSS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
Tejun Heo023bf6f2009-07-09 11:27:40 +0900178 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179}
180