blob: fa6f2b8163e03cc1bdc953bbb1e2b8282b826c7a [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>
Helge Deller8cf06fc2009-09-28 00:39:47 +020031#include <asm/thread_info.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
33/* ld script to make hppa Linux kernel */
34#ifndef CONFIG_64BIT
35OUTPUT_FORMAT("elf32-hppa-linux")
36OUTPUT_ARCH(hppa)
37#else
38OUTPUT_FORMAT("elf64-hppa-linux")
39OUTPUT_ARCH(hppa:hppa2.0w)
40#endif
41
42ENTRY(_stext)
43#ifndef CONFIG_64BIT
44jiffies = jiffies_64 + 4;
45#else
46jiffies = jiffies_64;
47#endif
48SECTIONS
49{
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070050 . = KERNEL_BINARY_TEXT_START;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070052 _text = .; /* Text and read-only data */
53 .text ALIGN(16) : {
Kyle McMartin1138a722008-05-22 14:38:26 -040054 HEAD_TEXT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070055 TEXT_TEXT
56 SCHED_TEXT
57 LOCK_TEXT
Helge Dellerd75f0542009-02-09 00:43:36 +010058 KPROBES_TEXT
59 IRQENTRY_TEXT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070060 *(.text.do_softirq)
61 *(.text.sys_exit)
62 *(.text.do_sigaltstack)
63 *(.text.do_fork)
64 *(.text.*)
65 *(.fixup)
66 *(.lock.text) /* out-of-line lock text */
67 *(.gnu.warning)
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 } = 0
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070069 /* End of text section */
70 _etext = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Steven Rostedta2d063a2011-05-19 21:34:58 -040072 /* Start of data section */
73 _sdata = .;
74
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070075 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070077 /* writeable */
78 /* Make sure this is page aligned so
79 * that we can properly leave these
80 * as writable
81 */
Sam Ravnborg1c593572007-10-18 00:04:34 -070082 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070083 data_start = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070084
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070085 /* unwind info */
86 .PARISC.unwind : {
87 __start___unwind = .;
88 *(.PARISC.unwind)
89 __stop___unwind = .;
Helge Deller2fd83032006-04-20 20:40:23 +000090 }
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070091
Helge Deller33a932d2009-11-28 20:33:11 +000092 EXCEPTION_TABLE(16)
93 NOTES
94
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070095 /* Data */
Tim Abbott57a8e112009-09-24 10:36:17 -040096 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070097
98 /* PA-RISC locks requires 16-byte alignment */
99 . = ALIGN(16);
Denys Vlasenkoa7df5542010-02-20 01:03:55 +0100100 .data..lock_aligned : {
101 *(.data..lock_aligned)
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700102 }
103
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700104 /* End of data section */
105 _edata = .;
106
107 /* BSS */
108 __bss_start = .;
109 /* page table entries need to be PAGE_SIZE aligned */
Sam Ravnborg1c593572007-10-18 00:04:34 -0700110 . = ALIGN(PAGE_SIZE);
Denys Vlasenkod56a3c12010-02-20 01:03:45 +0100111 .data..vmpages : {
112 *(.data..vm0.pmd)
113 *(.data..vm0.pgd)
114 *(.data..vm0.pte)
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700115 }
116 .bss : {
117 *(.bss)
118 *(COMMON)
119 }
120 __bss_stop = .;
Helge Deller2fd83032006-04-20 20:40:23 +0000121
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122#ifdef CONFIG_64BIT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700123 . = ALIGN(16);
124 /* Linkage tables */
125 .opd : {
126 *(.opd)
127 } PROVIDE (__gp = .);
128 .plt : {
129 *(.plt)
130 }
131 .dlt : {
132 *(.dlt)
133 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134#endif
135
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700136 /* reserve space for interrupt stack by aligning __init* to 16k */
137 . = ALIGN(16384);
138 __init_begin = .;
Tim Abbott57a8e112009-09-24 10:36:17 -0400139 INIT_TEXT_SECTION(16384)
James Bottomleyd7dd2ff2011-04-14 18:25:21 -0500140 . = ALIGN(PAGE_SIZE);
Tim Abbott57a8e112009-09-24 10:36:17 -0400141 INIT_DATA_SECTION(16)
Helge Deller8cf06fc2009-09-28 00:39:47 +0200142 /* we have to discard exit text and such at runtime, not link time */
143 .exit.text :
144 {
145 EXIT_TEXT
146 }
147 .exit.data :
148 {
149 EXIT_DATA
150 }
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700151
Tejun Heo0415b002011-03-24 18:50:09 +0100152 PERCPU_SECTION(L1_CACHE_BYTES)
Sam Ravnborg1c593572007-10-18 00:04:34 -0700153 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700154 __init_end = .;
155 /* freed after init ends here */
156 _end = . ;
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700157
Tejun Heo023bf6f2009-07-09 11:27:40 +0900158 STABS_DEBUG
159 .note 0 : { *(.note) }
160
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700161 /* Sections to be discarded */
Tejun Heo023bf6f2009-07-09 11:27:40 +0900162 DISCARDS
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700163 /DISCARD/ : {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164#ifdef CONFIG_64BIT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700165 /* temporary hack until binutils is fixed to not emit these
166 * for static binaries
167 */
168 *(.interp)
169 *(.dynsym)
170 *(.dynstr)
171 *(.dynamic)
172 *(.hash)
173 *(.gnu.hash)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174#endif
175 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176}