blob: 2e516b871752d818a09622c0f14104aed429254c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* Kernel link layout for various "sections"
2 *
3 * Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
4 * Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
5 * Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
6 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
7 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
8 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
Helge Deller2fd83032006-04-20 20:40:23 +00009 * Copyright (C) 2006 Helge Deller <deller@gmx.de>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 *
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <asm-generic/vmlinux.lds.h>
27/* needed for the processor specific cache alignment size */
28#include <asm/cache.h>
29#include <asm/page.h>
Helge Deller2fd83032006-04-20 20:40:23 +000030#include <asm/asm-offsets.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32/* ld script to make hppa Linux kernel */
33#ifndef CONFIG_64BIT
34OUTPUT_FORMAT("elf32-hppa-linux")
35OUTPUT_ARCH(hppa)
36#else
37OUTPUT_FORMAT("elf64-hppa-linux")
38OUTPUT_ARCH(hppa:hppa2.0w)
39#endif
40
41ENTRY(_stext)
42#ifndef CONFIG_64BIT
43jiffies = jiffies_64 + 4;
44#else
45jiffies = jiffies_64;
46#endif
47SECTIONS
48{
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070049 . = KERNEL_BINARY_TEXT_START;
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070051 _text = .; /* Text and read-only data */
52 .text ALIGN(16) : {
Kyle McMartin1138a722008-05-22 14:38:26 -040053 HEAD_TEXT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070054 TEXT_TEXT
55 SCHED_TEXT
56 LOCK_TEXT
57 *(.text.do_softirq)
58 *(.text.sys_exit)
59 *(.text.do_sigaltstack)
60 *(.text.do_fork)
61 *(.text.*)
62 *(.fixup)
63 *(.lock.text) /* out-of-line lock text */
64 *(.gnu.warning)
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 } = 0
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070066 /* End of text section */
67 _etext = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070069 RODATA
70 BUG_TABLE
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070072 /* writeable */
73 /* Make sure this is page aligned so
74 * that we can properly leave these
75 * as writable
76 */
Sam Ravnborg1c593572007-10-18 00:04:34 -070077 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070078 data_start = .;
79 . = ALIGN(16);
80 /* Exception table */
81 __ex_table : {
82 __start___ex_table = .;
83 *(__ex_table)
84 __stop___ex_table = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070085 }
86
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070087 NOTES
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070089 /* unwind info */
90 .PARISC.unwind : {
91 __start___unwind = .;
92 *(.PARISC.unwind)
93 __stop___unwind = .;
Helge Deller2fd83032006-04-20 20:40:23 +000094 }
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070095
96 /* rarely changed data like cpu maps */
97 . = ALIGN(16);
98 .data.read_mostly : {
99 *(.data.read_mostly)
100 }
101
102 . = ALIGN(L1_CACHE_BYTES);
103 /* Data */
104 .data : {
105 DATA_DATA
106 CONSTRUCTORS
107 }
108
109 . = ALIGN(L1_CACHE_BYTES);
110 .data.cacheline_aligned : {
111 *(.data.cacheline_aligned)
112 }
113
114 /* PA-RISC locks requires 16-byte alignment */
115 . = ALIGN(16);
116 .data.lock_aligned : {
117 *(.data.lock_aligned)
118 }
119
120 /* nosave data is really only used for software suspend...it's here
121 * just in case we ever implement it
122 */
Sam Ravnborg1c593572007-10-18 00:04:34 -0700123 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700124 __nosave_begin = .;
125 .data_nosave : {
126 *(.data.nosave)
127 }
Sam Ravnborg1c593572007-10-18 00:04:34 -0700128 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700129 __nosave_end = .;
130
131 /* End of data section */
132 _edata = .;
133
134 /* BSS */
135 __bss_start = .;
136 /* page table entries need to be PAGE_SIZE aligned */
Sam Ravnborg1c593572007-10-18 00:04:34 -0700137 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700138 .data.vmpages : {
139 *(.data.vm0.pmd)
140 *(.data.vm0.pgd)
141 *(.data.vm0.pte)
142 }
143 .bss : {
144 *(.bss)
145 *(COMMON)
146 }
147 __bss_stop = .;
Helge Deller2fd83032006-04-20 20:40:23 +0000148
149
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700150 /* assembler code expects init_task to be 16k aligned */
151 . = ALIGN(16384);
152 /* init_task */
153 .data.init_task : {
154 *(.data.init_task)
155 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157#ifdef CONFIG_64BIT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700158 . = ALIGN(16);
159 /* Linkage tables */
160 .opd : {
161 *(.opd)
162 } PROVIDE (__gp = .);
163 .plt : {
164 *(.plt)
165 }
166 .dlt : {
167 *(.dlt)
168 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169#endif
170
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700171 /* reserve space for interrupt stack by aligning __init* to 16k */
172 . = ALIGN(16384);
173 __init_begin = .;
174 .init.text : {
175 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100176 INIT_TEXT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700177 _einittext = .;
178 }
179 .init.data : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100180 INIT_DATA
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700181 }
182 . = ALIGN(16);
183 .init.setup : {
184 __setup_start = .;
185 *(.init.setup)
186 __setup_end = .;
187 }
188 .initcall.init : {
189 __initcall_start = .;
190 INITCALLS
191 __initcall_end = .;
192 }
193 .con_initcall.init : {
194 __con_initcall_start = .;
195 *(.con_initcall.init)
196 __con_initcall_end = .;
197 }
198 SECURITY_INIT
199
200 /* alternate instruction replacement. This is a mechanism x86 uses
201 * to detect the CPU type and replace generic instruction sequences
202 * with CPU specific ones. We don't currently do this in PA, but
203 * it seems like a good idea...
204 */
205 . = ALIGN(4);
206 .altinstructions : {
207 __alt_instructions = .;
208 *(.altinstructions)
209 __alt_instructions_end = .;
210 }
211 .altinstr_replacement : {
212 *(.altinstr_replacement)
213 }
214
215 /* .exit.text is discard at runtime, not link time, to deal with references
216 * from .altinstructions and .eh_frame
217 */
218 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100219 EXIT_TEXT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700220 }
221 .exit.data : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100222 EXIT_DATA
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700223 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800224#ifdef CONFIG_BLK_DEV_INITRD
Sam Ravnborg1c593572007-10-18 00:04:34 -0700225 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700226 .init.ramfs : {
227 __initramfs_start = .;
228 *(.init.ramfs)
229 __initramfs_end = .;
230 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800231#endif
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700232
Sam Ravnborg1c593572007-10-18 00:04:34 -0700233 PERCPU(PAGE_SIZE)
234 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700235 __init_end = .;
236 /* freed after init ends here */
237 _end = . ;
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700238
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700239 /* Sections to be discarded */
240 /DISCARD/ : {
241 *(.exitcall.exit)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242#ifdef CONFIG_64BIT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700243 /* temporary hack until binutils is fixed to not emit these
244 * for static binaries
245 */
246 *(.interp)
247 *(.dynsym)
248 *(.dynstr)
249 *(.dynamic)
250 *(.hash)
251 *(.gnu.hash)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252#endif
253 }
254
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700255 STABS_DEBUG
256 .note 0 : { *(.note) }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257}