Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* 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> | |
2fd83038 | 9 | * Copyright (C) 2006 Helge Deller <deller@gmx.de> |
1da177e4 LT |
10 | * |
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 | */ | |
1da177e4 LT |
26 | #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> | |
2fd83038 | 30 | #include <asm/asm-offsets.h> |
8cf06fc9 | 31 | #include <asm/thread_info.h> |
1da177e4 LT |
32 | |
33 | /* ld script to make hppa Linux kernel */ | |
34 | #ifndef CONFIG_64BIT | |
35 | OUTPUT_FORMAT("elf32-hppa-linux") | |
36 | OUTPUT_ARCH(hppa) | |
37 | #else | |
38 | OUTPUT_FORMAT("elf64-hppa-linux") | |
39 | OUTPUT_ARCH(hppa:hppa2.0w) | |
40 | #endif | |
41 | ||
42 | ENTRY(_stext) | |
43 | #ifndef CONFIG_64BIT | |
44 | jiffies = jiffies_64 + 4; | |
45 | #else | |
46 | jiffies = jiffies_64; | |
47 | #endif | |
48 | SECTIONS | |
49 | { | |
be1b3d8c | 50 | . = KERNEL_BINARY_TEXT_START; |
1da177e4 | 51 | |
be1b3d8c SR |
52 | _text = .; /* Text and read-only data */ |
53 | .text ALIGN(16) : { | |
1138a72c | 54 | HEAD_TEXT |
be1b3d8c SR |
55 | TEXT_TEXT |
56 | SCHED_TEXT | |
57 | LOCK_TEXT | |
d75f054a HD |
58 | KPROBES_TEXT |
59 | IRQENTRY_TEXT | |
be1b3d8c SR |
60 | *(.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) | |
1da177e4 | 68 | } = 0 |
be1b3d8c SR |
69 | /* End of text section */ |
70 | _etext = .; | |
1da177e4 | 71 | |
be1b3d8c | 72 | RODATA |
1da177e4 | 73 | |
be1b3d8c SR |
74 | /* writeable */ |
75 | /* Make sure this is page aligned so | |
76 | * that we can properly leave these | |
77 | * as writable | |
78 | */ | |
1c593571 | 79 | . = ALIGN(PAGE_SIZE); |
be1b3d8c | 80 | data_start = .; |
81b4b98a | 81 | |
be1b3d8c SR |
82 | /* unwind info */ |
83 | .PARISC.unwind : { | |
84 | __start___unwind = .; | |
85 | *(.PARISC.unwind) | |
86 | __stop___unwind = .; | |
87 | } | |
2fd83038 | 88 | |
33a932d1 HD |
89 | EXCEPTION_TABLE(16) |
90 | NOTES | |
91 | ||
be1b3d8c | 92 | /* Data */ |
57a8e116 | 93 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
1da177e4 | 94 | |
be1b3d8c SR |
95 | /* PA-RISC locks requires 16-byte alignment */ |
96 | . = ALIGN(16); | |
97 | .data.lock_aligned : { | |
98 | *(.data.lock_aligned) | |
99 | } | |
1da177e4 | 100 | |
be1b3d8c SR |
101 | /* End of data section */ |
102 | _edata = .; | |
1da177e4 | 103 | |
be1b3d8c SR |
104 | /* BSS */ |
105 | __bss_start = .; | |
106 | /* page table entries need to be PAGE_SIZE aligned */ | |
1c593571 | 107 | . = ALIGN(PAGE_SIZE); |
be1b3d8c SR |
108 | .data.vmpages : { |
109 | *(.data.vm0.pmd) | |
110 | *(.data.vm0.pgd) | |
111 | *(.data.vm0.pte) | |
112 | } | |
113 | .bss : { | |
114 | *(.bss) | |
115 | *(COMMON) | |
2fd83038 | 116 | } |
be1b3d8c | 117 | __bss_stop = .; |
2fd83038 | 118 | |
1da177e4 | 119 | #ifdef CONFIG_64BIT |
be1b3d8c SR |
120 | . = ALIGN(16); |
121 | /* Linkage tables */ | |
122 | .opd : { | |
123 | *(.opd) | |
124 | } PROVIDE (__gp = .); | |
125 | .plt : { | |
126 | *(.plt) | |
127 | } | |
128 | .dlt : { | |
129 | *(.dlt) | |
130 | } | |
1da177e4 LT |
131 | #endif |
132 | ||
be1b3d8c SR |
133 | /* reserve space for interrupt stack by aligning __init* to 16k */ |
134 | . = ALIGN(16384); | |
135 | __init_begin = .; | |
57a8e116 TA |
136 | INIT_TEXT_SECTION(16384) |
137 | INIT_DATA_SECTION(16) | |
8cf06fc9 HD |
138 | /* we have to discard exit text and such at runtime, not link time */ |
139 | .exit.text : | |
140 | { | |
141 | EXIT_TEXT | |
142 | } | |
143 | .exit.data : | |
144 | { | |
145 | EXIT_DATA | |
146 | } | |
be1b3d8c | 147 | |
1c593571 SR |
148 | PERCPU(PAGE_SIZE) |
149 | . = ALIGN(PAGE_SIZE); | |
be1b3d8c SR |
150 | __init_end = .; |
151 | /* freed after init ends here */ | |
152 | _end = . ; | |
5fb7dc37 | 153 | |
023bf6f1 TH |
154 | STABS_DEBUG |
155 | .note 0 : { *(.note) } | |
156 | ||
be1b3d8c | 157 | /* Sections to be discarded */ |
023bf6f1 | 158 | DISCARDS |
be1b3d8c | 159 | /DISCARD/ : { |
1da177e4 | 160 | #ifdef CONFIG_64BIT |
be1b3d8c SR |
161 | /* temporary hack until binutils is fixed to not emit these |
162 | * for static binaries | |
163 | */ | |
164 | *(.interp) | |
165 | *(.dynsym) | |
166 | *(.dynstr) | |
167 | *(.dynamic) | |
168 | *(.hash) | |
169 | *(.gnu.hash) | |
1da177e4 LT |
170 | #endif |
171 | } | |
1da177e4 | 172 | } |