blob: a0108fd6d341839293f745f8d642ef19a878a319 [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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#if defined(CONFIG_RAMKERNEL)
Greg Ungerer73e2fba2006-06-26 16:33:05 +100014#define RAM_START CONFIG_KERNELBASE
15#define RAM_LENGTH (CONFIG_RAMBASE + CONFIG_RAMSIZE - CONFIG_KERNELBASE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#define TEXT ram
17#define DATA ram
18#define INIT ram
Greg Ungerer10f204e2009-10-30 14:58:58 +100019#define BSSS ram
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#endif
21#if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
Greg Ungerer73e2fba2006-06-26 16:33:05 +100022#define RAM_START CONFIG_RAMBASE
23#define RAM_LENGTH CONFIG_RAMSIZE
Greg Ungerer1c952af2006-06-28 16:44:14 +100024#define ROMVEC_START CONFIG_ROMVEC
25#define ROMVEC_LENGTH CONFIG_ROMVECSIZE
26#define ROM_START CONFIG_ROMSTART
27#define ROM_LENGTH CONFIG_ROMSIZE
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#define TEXT rom
29#define DATA ram
30#define INIT ram
Greg Ungerer10f204e2009-10-30 14:58:58 +100031#define BSSS ram
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#endif
33
34#ifndef DATA_ADDR
35#define DATA_ADDR
36#endif
37
38
39OUTPUT_ARCH(m68k)
40ENTRY(_start)
41
42MEMORY {
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#ifdef ROM_START
45 romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
46 rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
Linus Torvalds1da177e2005-04-16 15:20:36 -070047#endif
48}
49
50jiffies = jiffies_64 + 4;
51
52SECTIONS {
53
54#ifdef ROMVEC_START
55 . = ROMVEC_START ;
56 .romvec : {
57 __rom_start = . ;
58 _romvec = .;
59 *(.data.initvect)
60 } > romvec
61#endif
62
63 .text : {
Eric W. Biedermanfd593d12006-12-07 02:14:04 +010064 _text = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 _stext = . ;
Greg Ungerer9b0e7412008-07-11 15:29:36 +100066 HEAD_TEXT
Sam Ravnborg76647092007-05-13 00:31:33 +020067 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 SCHED_TEXT
Sebastian Siewior779125c2008-05-01 12:16:46 +100069 LOCK_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 *(.text.lock)
71
72 . = ALIGN(16); /* Exception table */
73 __start___ex_table = .;
74 *(__ex_table)
75 __stop___ex_table = .;
76
77 *(.rodata) *(.rodata.*)
78 *(__vermagic) /* Kernel version magic */
Sebastian Siewior779125c2008-05-01 12:16:46 +100079 *(__markers_strings)
Linus Torvalds1da177e2005-04-16 15:20:36 -070080 *(.rodata1)
81 *(.rodata.str1.1)
82
83 /* Kernel symbol table: Normal symbols */
84 . = ALIGN(4);
85 __start___ksymtab = .;
86 *(__ksymtab)
87 __stop___ksymtab = .;
88
89 /* Kernel symbol table: GPL-only symbols */
90 __start___ksymtab_gpl = .;
91 *(__ksymtab_gpl)
92 __stop___ksymtab_gpl = .;
93
Greg Ungerer56591b92007-02-07 11:45:43 +100094 /* Kernel symbol table: Normal unused symbols */
95 __start___ksymtab_unused = .;
96 *(__ksymtab_unused)
97 __stop___ksymtab_unused = .;
98
99 /* Kernel symbol table: GPL-only unused symbols */
100 __start___ksymtab_unused_gpl = .;
101 *(__ksymtab_unused_gpl)
102 __stop___ksymtab_unused_gpl = .;
103
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800104 /* Kernel symbol table: GPL-future symbols */
105 __start___ksymtab_gpl_future = .;
106 *(__ksymtab_gpl_future)
107 __stop___ksymtab_gpl_future = .;
108
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109 /* Kernel symbol table: Normal symbols */
110 __start___kcrctab = .;
111 *(__kcrctab)
112 __stop___kcrctab = .;
113
114 /* Kernel symbol table: GPL-only symbols */
115 __start___kcrctab_gpl = .;
116 *(__kcrctab_gpl)
117 __stop___kcrctab_gpl = .;
118
Greg Ungererf38c8432008-05-12 14:02:23 -0700119 /* Kernel symbol table: Normal unused symbols */
120 __start___kcrctab_unused = .;
121 *(__kcrctab_unused)
122 __stop___kcrctab_unused = .;
123
124 /* Kernel symbol table: GPL-only unused symbols */
125 __start___kcrctab_unused_gpl = .;
126 *(__kcrctab_unused_gpl)
127 __stop___kcrctab_unused_gpl = .;
128
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800129 /* Kernel symbol table: GPL-future symbols */
130 __start___kcrctab_gpl_future = .;
131 *(__kcrctab_gpl_future)
132 __stop___kcrctab_gpl_future = .;
133
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 /* Kernel symbol table: strings */
135 *(__ksymtab_strings)
136
137 /* Built-in module parameters */
Greg Ungerer124df2d2005-11-07 14:09:50 +1000138 . = ALIGN(4) ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 __start___param = .;
140 *(__param)
141 __stop___param = .;
142
143 . = ALIGN(4) ;
144 _etext = . ;
145 } > TEXT
146
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 .data DATA_ADDR : {
148 . = ALIGN(4);
149 _sdata = . ;
Sam Ravnborgca967252007-05-17 13:38:44 +0200150 DATA_DATA
Greg Ungerera14f5e42009-04-17 22:55:06 +1000151 . = ALIGN(32);
152 *(.data.cacheline_aligned)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 . = ALIGN(8192) ;
154 *(.data.init_task)
155 _edata = . ;
156 } > DATA
157
158 .init : {
Tim Abbottf4bed4f2009-10-18 13:23:49 -0400159 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160 __init_begin = .;
161 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100162 INIT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 _einittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100164 INIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 . = ALIGN(16);
166 __setup_start = .;
167 *(.init.setup)
168 __setup_end = .;
169 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700170 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171 __initcall_end = .;
172 __con_initcall_start = .;
173 *(.con_initcall.init)
174 __con_initcall_end = .;
175 __security_initcall_start = .;
176 *(.security_initcall.init)
177 __security_initcall_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800178#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179 . = ALIGN(4);
180 __initramfs_start = .;
181 *(.init.ramfs)
182 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800183#endif
Tim Abbottf4bed4f2009-10-18 13:23:49 -0400184 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185 __init_end = .;
186 } > INIT
187
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 .bss : {
189 . = ALIGN(4);
190 _sbss = . ;
191 *(.bss)
192 *(COMMON)
193 . = ALIGN(4) ;
194 _ebss = . ;
Sebastian Siewior779125c2008-05-01 12:16:46 +1000195 _end = . ;
Greg Ungerer10f204e2009-10-30 14:58:58 +1000196 } > BSSS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197
Tejun Heo023bf6f2009-07-09 11:27:40 +0900198 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199}
200