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 | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 9 | * Copyright (C) 2006-2013 Helge Deller <deller@gmx.de> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | */ |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 11 | |
| 12 | /* |
| 13 | * Put page table entries (swapper_pg_dir) as the first thing in .bss. This |
| 14 | * will ensure that it has .bss alignment (PAGE_SIZE). |
| 15 | */ |
| 16 | #define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \ |
| 17 | *(.data..vm0.pgd) \ |
| 18 | *(.data..vm0.pte) |
| 19 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include <asm-generic/vmlinux.lds.h> |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | /* needed for the processor specific cache alignment size */ |
| 23 | #include <asm/cache.h> |
| 24 | #include <asm/page.h> |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 25 | #include <asm/asm-offsets.h> |
Helge Deller | 8cf06fc | 2009-09-28 00:39:47 +0200 | [diff] [blame] | 26 | #include <asm/thread_info.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
| 28 | /* ld script to make hppa Linux kernel */ |
| 29 | #ifndef CONFIG_64BIT |
| 30 | OUTPUT_FORMAT("elf32-hppa-linux") |
| 31 | OUTPUT_ARCH(hppa) |
| 32 | #else |
| 33 | OUTPUT_FORMAT("elf64-hppa-linux") |
| 34 | OUTPUT_ARCH(hppa:hppa2.0w) |
| 35 | #endif |
| 36 | |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 37 | ENTRY(parisc_kernel_start) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #ifndef CONFIG_64BIT |
| 39 | jiffies = jiffies_64 + 4; |
| 40 | #else |
| 41 | jiffies = jiffies_64; |
| 42 | #endif |
| 43 | SECTIONS |
| 44 | { |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 45 | . = KERNEL_BINARY_TEXT_START; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 47 | __init_begin = .; |
| 48 | HEAD_TEXT_SECTION |
| 49 | INIT_TEXT_SECTION(8) |
| 50 | |
| 51 | . = ALIGN(PAGE_SIZE); |
| 52 | INIT_DATA_SECTION(PAGE_SIZE) |
| 53 | /* we have to discard exit text and such at runtime, not link time */ |
| 54 | .exit.text : |
| 55 | { |
| 56 | EXIT_TEXT |
| 57 | } |
| 58 | .exit.data : |
| 59 | { |
| 60 | EXIT_DATA |
| 61 | } |
| 62 | PERCPU_SECTION(8) |
| 63 | . = ALIGN(PAGE_SIZE); |
| 64 | __init_end = .; |
| 65 | /* freed after init ends here */ |
| 66 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 67 | _text = .; /* Text and read-only data */ |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 68 | _stext = .; |
| 69 | .text ALIGN(PAGE_SIZE) : { |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 70 | TEXT_TEXT |
| 71 | SCHED_TEXT |
| 72 | LOCK_TEXT |
Helge Deller | d75f054 | 2009-02-09 00:43:36 +0100 | [diff] [blame] | 73 | KPROBES_TEXT |
| 74 | IRQENTRY_TEXT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 75 | *(.text.do_softirq) |
| 76 | *(.text.sys_exit) |
| 77 | *(.text.do_sigaltstack) |
| 78 | *(.text.do_fork) |
| 79 | *(.text.*) |
| 80 | *(.fixup) |
| 81 | *(.lock.text) /* out-of-line lock text */ |
| 82 | *(.gnu.warning) |
John David Anglin | ed5fb24 | 2012-05-17 10:34:34 -0400 | [diff] [blame] | 83 | } |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 84 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 85 | _etext = .; |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 86 | /* End of text section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
Steven Rostedt | a2d063a | 2011-05-19 21:34:58 -0400 | [diff] [blame] | 88 | /* Start of data section */ |
| 89 | _sdata = .; |
| 90 | |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 91 | RO_DATA_SECTION(8) |
| 92 | |
| 93 | #ifdef CONFIG_64BIT |
| 94 | . = ALIGN(16); |
| 95 | /* Linkage tables */ |
| 96 | .opd : { |
| 97 | *(.opd) |
| 98 | } PROVIDE (__gp = .); |
| 99 | .plt : { |
| 100 | *(.plt) |
| 101 | } |
| 102 | .dlt : { |
| 103 | *(.dlt) |
| 104 | } |
| 105 | #endif |
| 106 | |
| 107 | /* unwind info */ |
| 108 | .PARISC.unwind : { |
| 109 | __start___unwind = .; |
| 110 | *(.PARISC.unwind) |
| 111 | __stop___unwind = .; |
| 112 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 113 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 114 | /* writeable */ |
| 115 | /* Make sure this is page aligned so |
| 116 | * that we can properly leave these |
| 117 | * as writable |
| 118 | */ |
Sam Ravnborg | 1c59357 | 2007-10-18 00:04:34 -0700 | [diff] [blame] | 119 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 120 | data_start = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 122 | EXCEPTION_TABLE(8) |
Helge Deller | 33a932d | 2009-11-28 20:33:11 +0000 | [diff] [blame] | 123 | NOTES |
| 124 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 125 | /* Data */ |
Helge Deller | 9372450 | 2013-05-07 19:28:52 +0000 | [diff] [blame] | 126 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE) |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 127 | |
| 128 | /* PA-RISC locks requires 16-byte alignment */ |
| 129 | . = ALIGN(16); |
Denys Vlasenko | a7df554 | 2010-02-20 01:03:55 +0100 | [diff] [blame] | 130 | .data..lock_aligned : { |
| 131 | *(.data..lock_aligned) |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 132 | } |
| 133 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 134 | /* End of data section */ |
| 135 | _edata = .; |
| 136 | |
| 137 | /* BSS */ |
Helge Deller | 161bd3b | 2013-11-30 22:07:51 +0100 | [diff] [blame] | 138 | BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 8) |
Helge Deller | 2fd8303 | 2006-04-20 20:40:23 +0000 | [diff] [blame] | 139 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 140 | _end = . ; |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 141 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 142 | STABS_DEBUG |
| 143 | .note 0 : { *(.note) } |
| 144 | |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 145 | /* Sections to be discarded */ |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 146 | DISCARDS |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 147 | /DISCARD/ : { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | #ifdef CONFIG_64BIT |
Sam Ravnborg | be1b3d8 | 2007-10-18 00:04:25 -0700 | [diff] [blame] | 149 | /* temporary hack until binutils is fixed to not emit these |
| 150 | * for static binaries |
| 151 | */ |
| 152 | *(.interp) |
| 153 | *(.dynsym) |
| 154 | *(.dynstr) |
| 155 | *(.dynamic) |
| 156 | *(.hash) |
| 157 | *(.gnu.hash) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | #endif |
| 159 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | } |