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 = .; |
Tim Abbott | 57a8e11 | 2009-09-24 10:36:17 -0400 | [diff] [blame^] | 80 | EXCEPTION_TABLE(16) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 82 | NOTES |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 84 | /* unwind info */ |
| 85 | .PARISC.unwind : { |
| 86 | __start___unwind = .; |
| 87 | *(.PARISC.unwind) |
| 88 | __stop___unwind = .; |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 89 | } |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 90 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 91 | /* Data */ |
Tim Abbott | 57a8e11 | 2009-09-24 10:36:17 -0400 | [diff] [blame^] | 92 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 93 | |
| 94 | /* PA-RISC locks requires 16-byte alignment */ |
| 95 | . = ALIGN(16); |
| 96 | .data.lock_aligned : { |
| 97 | *(.data.lock_aligned) |
| 98 | } |
| 99 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 100 | /* End of data section */ |
| 101 | _edata = .; |
| 102 | |
| 103 | /* BSS */ |
| 104 | __bss_start = .; |
| 105 | /* page table entries need to be PAGE_SIZE aligned */ |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 106 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 107 | .data.vmpages : { |
| 108 | *(.data.vm0.pmd) |
| 109 | *(.data.vm0.pgd) |
| 110 | *(.data.vm0.pte) |
| 111 | } |
| 112 | .bss : { |
| 113 | *(.bss) |
| 114 | *(COMMON) |
| 115 | } |
| 116 | __bss_stop = .; |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 117 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | #ifdef CONFIG_64BIT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 119 | . = ALIGN(16); |
| 120 | /* Linkage tables */ |
| 121 | .opd : { |
| 122 | *(.opd) |
| 123 | } PROVIDE (__gp = .); |
| 124 | .plt : { |
| 125 | *(.plt) |
| 126 | } |
| 127 | .dlt : { |
| 128 | *(.dlt) |
| 129 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | #endif |
| 131 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 132 | /* reserve space for interrupt stack by aligning __init* to 16k */ |
| 133 | . = ALIGN(16384); |
| 134 | __init_begin = .; |
Tim Abbott | 57a8e11 | 2009-09-24 10:36:17 -0400 | [diff] [blame^] | 135 | INIT_TEXT_SECTION(16384) |
| 136 | INIT_DATA_SECTION(16) |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 137 | |
| 138 | /* alternate instruction replacement. This is a mechanism x86 uses |
| 139 | * to detect the CPU type and replace generic instruction sequences |
| 140 | * with CPU specific ones. We don't currently do this in PA, but |
| 141 | * it seems like a good idea... |
| 142 | */ |
| 143 | . = ALIGN(4); |
| 144 | .altinstructions : { |
| 145 | __alt_instructions = .; |
| 146 | *(.altinstructions) |
| 147 | __alt_instructions_end = .; |
| 148 | } |
| 149 | .altinstr_replacement : { |
| 150 | *(.altinstr_replacement) |
| 151 | } |
| 152 | |
| 153 | /* .exit.text is discard at runtime, not link time, to deal with references |
| 154 | * from .altinstructions and .eh_frame |
| 155 | */ |
| 156 | .exit.text : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 157 | EXIT_TEXT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 158 | } |
| 159 | .exit.data : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 160 | EXIT_DATA |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 161 | } |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 162 | |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 163 | PERCPU(PAGE_SIZE) |
| 164 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 165 | __init_end = .; |
| 166 | /* freed after init ends here */ |
| 167 | _end = . ; |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 168 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 169 | STABS_DEBUG |
| 170 | .note 0 : { *(.note) } |
| 171 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 172 | /* Sections to be discarded */ |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 173 | DISCARDS |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 174 | /DISCARD/ : { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | #ifdef CONFIG_64BIT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 176 | /* temporary hack until binutils is fixed to not emit these |
| 177 | * for static binaries |
| 178 | */ |
| 179 | *(.interp) |
| 180 | *(.dynsym) |
| 181 | *(.dynstr) |
| 182 | *(.dynamic) |
| 183 | *(.hash) |
| 184 | *(.gnu.hash) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | #endif |
| 186 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | } |