blob: 0dacc5ca555afe7643da970bf9f3ae75ebc88790 [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 Deller161bd3b2013-11-30 22:07:51 +01009 * Copyright (C) 2006-2013 Helge Deller <deller@gmx.de>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 */
Helge Deller161bd3b2013-11-30 22:07:51 +010011
12/*
13 * Put page table entries (swapper_pg_dir) as the first thing in .bss. This
14 * will ensure that it has .bss alignment (PAGE_SIZE).
15 */
16#define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \
17 *(.data..vm0.pgd) \
18 *(.data..vm0.pte)
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <asm-generic/vmlinux.lds.h>
Helge Deller161bd3b2013-11-30 22:07:51 +010021
Linus Torvalds1da177e2005-04-16 15:20:36 -070022/* needed for the processor specific cache alignment size */
23#include <asm/cache.h>
24#include <asm/page.h>
Helge Deller2fd83032006-04-20 20:40:23 +000025#include <asm/asm-offsets.h>
Helge Deller8cf06fc2009-09-28 00:39:47 +020026#include <asm/thread_info.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
28/* ld script to make hppa Linux kernel */
29#ifndef CONFIG_64BIT
30OUTPUT_FORMAT("elf32-hppa-linux")
31OUTPUT_ARCH(hppa)
32#else
33OUTPUT_FORMAT("elf64-hppa-linux")
34OUTPUT_ARCH(hppa:hppa2.0w)
35#endif
36
Helge Deller161bd3b2013-11-30 22:07:51 +010037ENTRY(parisc_kernel_start)
Linus Torvalds1da177e2005-04-16 15:20:36 -070038#ifndef CONFIG_64BIT
39jiffies = jiffies_64 + 4;
40#else
41jiffies = jiffies_64;
42#endif
43SECTIONS
44{
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070045 . = KERNEL_BINARY_TEXT_START;
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Helge Deller161bd3b2013-11-30 22:07:51 +010047 __init_begin = .;
48 HEAD_TEXT_SECTION
49 INIT_TEXT_SECTION(8)
50
51 . = ALIGN(PAGE_SIZE);
52 INIT_DATA_SECTION(PAGE_SIZE)
53 /* we have to discard exit text and such at runtime, not link time */
54 .exit.text :
55 {
56 EXIT_TEXT
57 }
58 .exit.data :
59 {
60 EXIT_DATA
61 }
62 PERCPU_SECTION(8)
63 . = ALIGN(PAGE_SIZE);
64 __init_end = .;
65 /* freed after init ends here */
66
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070067 _text = .; /* Text and read-only data */
Helge Deller161bd3b2013-11-30 22:07:51 +010068 _stext = .;
69 .text ALIGN(PAGE_SIZE) : {
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070070 TEXT_TEXT
71 SCHED_TEXT
72 LOCK_TEXT
Helge Dellerd75f0542009-02-09 00:43:36 +010073 KPROBES_TEXT
74 IRQENTRY_TEXT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070075 *(.text.do_softirq)
76 *(.text.sys_exit)
77 *(.text.do_sigaltstack)
78 *(.text.do_fork)
79 *(.text.*)
80 *(.fixup)
81 *(.lock.text) /* out-of-line lock text */
82 *(.gnu.warning)
John David Anglined5fb242012-05-17 10:34:34 -040083 }
Helge Deller161bd3b2013-11-30 22:07:51 +010084 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -070085 _etext = .;
Helge Deller161bd3b2013-11-30 22:07:51 +010086 /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070087
Steven Rostedta2d063a2011-05-19 21:34:58 -040088 /* Start of data section */
89 _sdata = .;
90
Helge Deller161bd3b2013-11-30 22:07:51 +010091 RO_DATA_SECTION(8)
92
93#ifdef CONFIG_64BIT
94 . = ALIGN(16);
95 /* Linkage tables */
96 .opd : {
97 *(.opd)
98 } PROVIDE (__gp = .);
99 .plt : {
100 *(.plt)
101 }
102 .dlt : {
103 *(.dlt)
104 }
105#endif
106
107 /* unwind info */
108 .PARISC.unwind : {
109 __start___unwind = .;
110 *(.PARISC.unwind)
111 __stop___unwind = .;
112 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700114 /* writeable */
115 /* Make sure this is page aligned so
116 * that we can properly leave these
117 * as writable
118 */
Sam Ravnborg1c593572007-10-18 00:04:34 -0700119 . = ALIGN(PAGE_SIZE);
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700120 data_start = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121
Helge Deller161bd3b2013-11-30 22:07:51 +0100122 EXCEPTION_TABLE(8)
Helge Deller33a932d2009-11-28 20:33:11 +0000123 NOTES
124
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700125 /* Data */
Helge Deller93724502013-05-07 19:28:52 +0000126 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700127
128 /* PA-RISC locks requires 16-byte alignment */
129 . = ALIGN(16);
Denys Vlasenkoa7df5542010-02-20 01:03:55 +0100130 .data..lock_aligned : {
131 *(.data..lock_aligned)
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700132 }
133
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700134 /* End of data section */
135 _edata = .;
136
137 /* BSS */
Helge Deller161bd3b2013-11-30 22:07:51 +0100138 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 8)
Helge Deller2fd83032006-04-20 20:40:23 +0000139
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700140 _end = . ;
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700141
Tejun Heo023bf6f2009-07-09 11:27:40 +0900142 STABS_DEBUG
143 .note 0 : { *(.note) }
144
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700145 /* Sections to be discarded */
Tejun Heo023bf6f2009-07-09 11:27:40 +0900146 DISCARDS
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700147 /DISCARD/ : {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148#ifdef CONFIG_64BIT
Sam Ravnborgbe1b3d82007-10-18 00:04:25 -0700149 /* temporary hack until binutils is fixed to not emit these
150 * for static binaries
151 */
152 *(.interp)
153 *(.dynsym)
154 *(.dynstr)
155 *(.dynamic)
156 *(.hash)
157 *(.gnu.hash)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158#endif
159 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160}