Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 9 | * Copyright (C) 2006 Helge Deller <deller@gmx.de> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 30 | #include <asm/asm-offsets.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | |
| 32 | /* ld script to make hppa Linux kernel */ |
| 33 | #ifndef CONFIG_64BIT |
| 34 | OUTPUT_FORMAT("elf32-hppa-linux") |
| 35 | OUTPUT_ARCH(hppa) |
| 36 | #else |
| 37 | OUTPUT_FORMAT("elf64-hppa-linux") |
| 38 | OUTPUT_ARCH(hppa:hppa2.0w) |
| 39 | #endif |
| 40 | |
| 41 | ENTRY(_stext) |
| 42 | #ifndef CONFIG_64BIT |
| 43 | jiffies = jiffies_64 + 4; |
| 44 | #else |
| 45 | jiffies = jiffies_64; |
| 46 | #endif |
| 47 | SECTIONS |
| 48 | { |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 49 | . = KERNEL_BINARY_TEXT_START; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 51 | _text = .; /* Text and read-only data */ |
| 52 | .text ALIGN(16) : { |
Kyle McMartin | 1138a72 | 2008-05-22 14:38:26 -0400 | [diff] [blame] | 53 | HEAD_TEXT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 54 | TEXT_TEXT |
| 55 | SCHED_TEXT |
| 56 | LOCK_TEXT |
Helge Deller | d75f054 | 2009-02-09 00:43:36 +0100 | [diff] [blame] | 57 | KPROBES_TEXT |
| 58 | IRQENTRY_TEXT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 59 | *(.text.do_softirq) |
| 60 | *(.text.sys_exit) |
| 61 | *(.text.do_sigaltstack) |
| 62 | *(.text.do_fork) |
| 63 | *(.text.*) |
| 64 | *(.fixup) |
| 65 | *(.lock.text) /* out-of-line lock text */ |
| 66 | *(.gnu.warning) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | } = 0 |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 68 | /* End of text section */ |
| 69 | _etext = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 71 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 73 | /* writeable */ |
| 74 | /* Make sure this is page aligned so |
| 75 | * that we can properly leave these |
| 76 | * as writable |
| 77 | */ |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 78 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 79 | data_start = .; |
| 80 | . = ALIGN(16); |
| 81 | /* Exception table */ |
| 82 | __ex_table : { |
| 83 | __start___ex_table = .; |
| 84 | *(__ex_table) |
| 85 | __stop___ex_table = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 88 | NOTES |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 90 | /* unwind info */ |
| 91 | .PARISC.unwind : { |
| 92 | __start___unwind = .; |
| 93 | *(.PARISC.unwind) |
| 94 | __stop___unwind = .; |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 95 | } |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 96 | |
| 97 | /* rarely changed data like cpu maps */ |
| 98 | . = ALIGN(16); |
| 99 | .data.read_mostly : { |
| 100 | *(.data.read_mostly) |
| 101 | } |
| 102 | |
| 103 | . = ALIGN(L1_CACHE_BYTES); |
| 104 | /* Data */ |
| 105 | .data : { |
| 106 | DATA_DATA |
| 107 | CONSTRUCTORS |
| 108 | } |
| 109 | |
| 110 | . = ALIGN(L1_CACHE_BYTES); |
| 111 | .data.cacheline_aligned : { |
| 112 | *(.data.cacheline_aligned) |
| 113 | } |
| 114 | |
| 115 | /* PA-RISC locks requires 16-byte alignment */ |
| 116 | . = ALIGN(16); |
| 117 | .data.lock_aligned : { |
| 118 | *(.data.lock_aligned) |
| 119 | } |
| 120 | |
| 121 | /* nosave data is really only used for software suspend...it's here |
| 122 | * just in case we ever implement it |
| 123 | */ |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 124 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 125 | __nosave_begin = .; |
| 126 | .data_nosave : { |
| 127 | *(.data.nosave) |
| 128 | } |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 129 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 130 | __nosave_end = .; |
| 131 | |
| 132 | /* End of data section */ |
| 133 | _edata = .; |
| 134 | |
| 135 | /* BSS */ |
| 136 | __bss_start = .; |
| 137 | /* page table entries need to be PAGE_SIZE aligned */ |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 138 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 139 | .data.vmpages : { |
| 140 | *(.data.vm0.pmd) |
| 141 | *(.data.vm0.pgd) |
| 142 | *(.data.vm0.pte) |
| 143 | } |
| 144 | .bss : { |
| 145 | *(.bss) |
| 146 | *(COMMON) |
| 147 | } |
| 148 | __bss_stop = .; |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 149 | |
| 150 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 151 | /* assembler code expects init_task to be 16k aligned */ |
| 152 | . = ALIGN(16384); |
| 153 | /* init_task */ |
| 154 | .data.init_task : { |
| 155 | *(.data.init_task) |
| 156 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | #ifdef CONFIG_64BIT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 159 | . = ALIGN(16); |
| 160 | /* Linkage tables */ |
| 161 | .opd : { |
| 162 | *(.opd) |
| 163 | } PROVIDE (__gp = .); |
| 164 | .plt : { |
| 165 | *(.plt) |
| 166 | } |
| 167 | .dlt : { |
| 168 | *(.dlt) |
| 169 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | #endif |
| 171 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 172 | /* reserve space for interrupt stack by aligning __init* to 16k */ |
| 173 | . = ALIGN(16384); |
| 174 | __init_begin = .; |
| 175 | .init.text : { |
| 176 | _sinittext = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 177 | INIT_TEXT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 178 | _einittext = .; |
| 179 | } |
| 180 | .init.data : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 181 | INIT_DATA |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 182 | } |
| 183 | . = ALIGN(16); |
| 184 | .init.setup : { |
| 185 | __setup_start = .; |
| 186 | *(.init.setup) |
| 187 | __setup_end = .; |
| 188 | } |
| 189 | .initcall.init : { |
| 190 | __initcall_start = .; |
| 191 | INITCALLS |
| 192 | __initcall_end = .; |
| 193 | } |
| 194 | .con_initcall.init : { |
| 195 | __con_initcall_start = .; |
| 196 | *(.con_initcall.init) |
| 197 | __con_initcall_end = .; |
| 198 | } |
| 199 | SECURITY_INIT |
| 200 | |
| 201 | /* alternate instruction replacement. This is a mechanism x86 uses |
| 202 | * to detect the CPU type and replace generic instruction sequences |
| 203 | * with CPU specific ones. We don't currently do this in PA, but |
| 204 | * it seems like a good idea... |
| 205 | */ |
| 206 | . = ALIGN(4); |
| 207 | .altinstructions : { |
| 208 | __alt_instructions = .; |
| 209 | *(.altinstructions) |
| 210 | __alt_instructions_end = .; |
| 211 | } |
| 212 | .altinstr_replacement : { |
| 213 | *(.altinstr_replacement) |
| 214 | } |
| 215 | |
| 216 | /* .exit.text is discard at runtime, not link time, to deal with references |
| 217 | * from .altinstructions and .eh_frame |
| 218 | */ |
| 219 | .exit.text : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 220 | EXIT_TEXT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 221 | } |
| 222 | .exit.data : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 223 | EXIT_DATA |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 224 | } |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 225 | #ifdef CONFIG_BLK_DEV_INITRD |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 226 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 227 | .init.ramfs : { |
| 228 | __initramfs_start = .; |
| 229 | *(.init.ramfs) |
| 230 | __initramfs_end = .; |
| 231 | } |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 232 | #endif |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 233 | |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 234 | PERCPU(PAGE_SIZE) |
| 235 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 236 | __init_end = .; |
| 237 | /* freed after init ends here */ |
| 238 | _end = . ; |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 239 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 240 | /* Sections to be discarded */ |
| 241 | /DISCARD/ : { |
| 242 | *(.exitcall.exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | #ifdef CONFIG_64BIT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 244 | /* temporary hack until binutils is fixed to not emit these |
| 245 | * for static binaries |
| 246 | */ |
| 247 | *(.interp) |
| 248 | *(.dynsym) |
| 249 | *(.dynstr) |
| 250 | *(.dynamic) |
| 251 | *(.hash) |
| 252 | *(.gnu.hash) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | #endif |
| 254 | } |
| 255 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 256 | STABS_DEBUG |
| 257 | .note 0 : { *(.note) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | } |