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