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> |
Helge Deller | 8cf06fc | 2009-09-28 00:39:47 +0200 | [diff] [blame] | 31 | #include <asm/thread_info.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | { |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 50 | . = KERNEL_BINARY_TEXT_START; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 52 | _text = .; /* Text and read-only data */ |
John David Anglin | ed5fb24 | 2012-05-17 10:34:34 -0400 | [diff] [blame] | 53 | .head ALIGN(16) : { |
Kyle McMartin | 1138a72 | 2008-05-22 14:38:26 -0400 | [diff] [blame] | 54 | HEAD_TEXT |
John David Anglin | ed5fb24 | 2012-05-17 10:34:34 -0400 | [diff] [blame] | 55 | } = 0 |
| 56 | .text ALIGN(16) : { |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 57 | TEXT_TEXT |
| 58 | SCHED_TEXT |
| 59 | LOCK_TEXT |
Helge Deller | d75f054 | 2009-02-09 00:43:36 +0100 | [diff] [blame] | 60 | KPROBES_TEXT |
| 61 | IRQENTRY_TEXT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 62 | *(.text.do_softirq) |
| 63 | *(.text.sys_exit) |
| 64 | *(.text.do_sigaltstack) |
| 65 | *(.text.do_fork) |
| 66 | *(.text.*) |
| 67 | *(.fixup) |
| 68 | *(.lock.text) /* out-of-line lock text */ |
| 69 | *(.gnu.warning) |
John David Anglin | ed5fb24 | 2012-05-17 10:34:34 -0400 | [diff] [blame] | 70 | } |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 71 | /* End of text section */ |
| 72 | _etext = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
Steven Rostedt | a2d063a | 2011-05-19 21:34:58 -0400 | [diff] [blame] | 74 | /* Start of data section */ |
| 75 | _sdata = .; |
| 76 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 77 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 79 | /* writeable */ |
| 80 | /* Make sure this is page aligned so |
| 81 | * that we can properly leave these |
| 82 | * as writable |
| 83 | */ |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 84 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 85 | data_start = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 87 | /* unwind info */ |
| 88 | .PARISC.unwind : { |
| 89 | __start___unwind = .; |
| 90 | *(.PARISC.unwind) |
| 91 | __stop___unwind = .; |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 92 | } |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 93 | |
Helge Deller | 33a932d | 2009-11-28 20:33:11 +0000 | [diff] [blame] | 94 | EXCEPTION_TABLE(16) |
| 95 | NOTES |
| 96 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 97 | /* Data */ |
Helge Deller | 9372450 | 2013-05-07 19:28:52 +0000 | [diff] [blame] | 98 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE) |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 99 | |
| 100 | /* PA-RISC locks requires 16-byte alignment */ |
| 101 | . = ALIGN(16); |
Denys Vlasenko | a7df554 | 2010-02-20 01:03:55 +0100 | [diff] [blame] | 102 | .data..lock_aligned : { |
| 103 | *(.data..lock_aligned) |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 104 | } |
| 105 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 106 | /* End of data section */ |
| 107 | _edata = .; |
| 108 | |
| 109 | /* BSS */ |
| 110 | __bss_start = .; |
| 111 | /* page table entries need to be PAGE_SIZE aligned */ |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 112 | . = ALIGN(PAGE_SIZE); |
Denys Vlasenko | d56a3c1 | 2010-02-20 01:03:45 +0100 | [diff] [blame] | 113 | .data..vmpages : { |
| 114 | *(.data..vm0.pmd) |
| 115 | *(.data..vm0.pgd) |
| 116 | *(.data..vm0.pte) |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 117 | } |
| 118 | .bss : { |
| 119 | *(.bss) |
| 120 | *(COMMON) |
| 121 | } |
| 122 | __bss_stop = .; |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 123 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | #ifdef CONFIG_64BIT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 125 | . = ALIGN(16); |
| 126 | /* Linkage tables */ |
| 127 | .opd : { |
| 128 | *(.opd) |
| 129 | } PROVIDE (__gp = .); |
| 130 | .plt : { |
| 131 | *(.plt) |
| 132 | } |
| 133 | .dlt : { |
| 134 | *(.dlt) |
| 135 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | #endif |
| 137 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 138 | /* reserve space for interrupt stack by aligning __init* to 16k */ |
| 139 | . = ALIGN(16384); |
| 140 | __init_begin = .; |
Tim Abbott | 57a8e11 | 2009-09-24 10:36:17 -0400 | [diff] [blame] | 141 | INIT_TEXT_SECTION(16384) |
James Bottomley | d7dd2ff | 2011-04-14 18:25:21 -0500 | [diff] [blame] | 142 | . = ALIGN(PAGE_SIZE); |
Tim Abbott | 57a8e11 | 2009-09-24 10:36:17 -0400 | [diff] [blame] | 143 | INIT_DATA_SECTION(16) |
Helge Deller | 8cf06fc | 2009-09-28 00:39:47 +0200 | [diff] [blame] | 144 | /* we have to discard exit text and such at runtime, not link time */ |
| 145 | .exit.text : |
| 146 | { |
| 147 | EXIT_TEXT |
| 148 | } |
| 149 | .exit.data : |
| 150 | { |
| 151 | EXIT_DATA |
| 152 | } |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 153 | |
Tejun Heo | 0415b00d1 | 2011-03-24 18:50:09 +0100 | [diff] [blame] | 154 | PERCPU_SECTION(L1_CACHE_BYTES) |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 155 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 156 | __init_end = .; |
| 157 | /* freed after init ends here */ |
| 158 | _end = . ; |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 159 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 160 | STABS_DEBUG |
| 161 | .note 0 : { *(.note) } |
| 162 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 163 | /* Sections to be discarded */ |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 164 | DISCARDS |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 165 | /DISCARD/ : { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | #ifdef CONFIG_64BIT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 167 | /* temporary hack until binutils is fixed to not emit these |
| 168 | * for static binaries |
| 169 | */ |
| 170 | *(.interp) |
| 171 | *(.dynsym) |
| 172 | *(.dynstr) |
| 173 | *(.dynamic) |
| 174 | *(.hash) |
| 175 | *(.gnu.hash) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | #endif |
| 177 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | } |