Ralf Baechle | dbee90b | 2006-02-02 14:31:16 +0000 | [diff] [blame] | 1 | #include <asm/asm-offsets.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #include <asm-generic/vmlinux.lds.h> |
| 3 | |
Ralf Baechle | 41c594a | 2006-04-05 09:45:45 +0100 | [diff] [blame] | 4 | #undef mips |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | #define mips mips |
| 6 | OUTPUT_ARCH(mips) |
| 7 | ENTRY(kernel_entry) |
| 8 | jiffies = JIFFIES; |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 9 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | SECTIONS |
| 11 | { |
| 12 | #ifdef CONFIG_BOOT_ELF64 |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 13 | /* Read-only sections, merged into text segment: */ |
| 14 | /* . = 0xc000000000000000; */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 16 | /* This is the value for an Origin kernel, taken from an IRIX kernel. */ |
| 17 | /* . = 0xc00000000001c000; */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 19 | /* Set the vaddr for the text segment to a value |
| 20 | * >= 0xa800 0000 0001 9000 if no symmon is going to configured |
| 21 | * >= 0xa800 0000 0030 0000 otherwise |
| 22 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 24 | /* . = 0xa800000000300000; */ |
| 25 | /* . = 0xa800000000300000; */ |
| 26 | . = 0xffffffff80300000; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | #endif |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 28 | . = LOADADDR; |
| 29 | /* read-only */ |
| 30 | _text = .; /* Text and read-only data */ |
| 31 | .text : { |
| 32 | TEXT_TEXT |
| 33 | SCHED_TEXT |
| 34 | LOCK_TEXT |
| 35 | *(.fixup) |
| 36 | *(.gnu.warning) |
| 37 | } =0 |
| 38 | _etext = .; /* End of text section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 40 | /* Exception table */ |
| 41 | . = ALIGN(16); |
| 42 | __ex_table : { |
| 43 | __start___ex_table = .; |
| 44 | *(__ex_table) |
| 45 | __stop___ex_table = .; |
| 46 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 48 | /* Exception table for data bus errors */ |
| 49 | __dbe_table : { |
| 50 | __start___dbe_table = .; |
| 51 | *(__dbe_table) |
| 52 | __stop___dbe_table = .; |
| 53 | } |
| 54 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 56 | /* writeable */ |
| 57 | .data : { /* Data */ |
| 58 | . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ |
| 59 | /* |
| 60 | * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which |
| 61 | * limits the maximum alignment to at most 32kB and results in the following |
| 62 | * warning: |
| 63 | * |
| 64 | * CC arch/mips/kernel/init_task.o |
| 65 | * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’ |
| 66 | * is greater than maximum object file alignment. Using 32768 |
| 67 | */ |
| 68 | . = ALIGN(_PAGE_SIZE); |
| 69 | *(.data.init_task) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 71 | DATA_DATA |
| 72 | CONSTRUCTORS |
| 73 | } |
| 74 | _gp = . + 0x8000; |
| 75 | .lit8 : { |
| 76 | *(.lit8) |
| 77 | } |
| 78 | .lit4 : { |
| 79 | *(.lit4) |
| 80 | } |
| 81 | /* We want the small data sections together, so single-instruction offsets |
| 82 | can access them all, and initialized data all before uninitialized, so |
| 83 | we can shorten the on-disk segment size. */ |
| 84 | .sdata : { |
| 85 | *(.sdata) |
| 86 | } |
Maciej W. Rozycki | 6f6b394 | 2007-10-01 13:24:04 +0100 | [diff] [blame] | 87 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 88 | . = ALIGN(_PAGE_SIZE); |
| 89 | .data_nosave : { |
| 90 | __nosave_begin = .; |
| 91 | *(.data.nosave) |
| 92 | } |
| 93 | . = ALIGN(_PAGE_SIZE); |
| 94 | __nosave_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 96 | . = ALIGN(32); |
| 97 | .data.cacheline_aligned : { |
| 98 | *(.data.cacheline_aligned) |
| 99 | } |
| 100 | _edata = .; /* End of data section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 102 | /* will be freed after init */ |
| 103 | . = ALIGN(_PAGE_SIZE); /* Init code and data */ |
| 104 | __init_begin = .; |
| 105 | .init.text : { |
| 106 | _sinittext = .; |
| 107 | *(.init.text) |
| 108 | _einittext = .; |
| 109 | } |
| 110 | .init.data : { |
| 111 | *(.init.data) |
| 112 | } |
| 113 | . = ALIGN(16); |
| 114 | .init.setup : { |
| 115 | __setup_start = .; |
| 116 | *(.init.setup) |
| 117 | __setup_end = .; |
| 118 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 120 | .initcall.init : { |
| 121 | __initcall_start = .; |
| 122 | INITCALLS |
| 123 | __initcall_end = .; |
| 124 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 126 | .con_initcall.init : { |
| 127 | __con_initcall_start = .; |
| 128 | *(.con_initcall.init) |
| 129 | __con_initcall_end = .; |
| 130 | } |
| 131 | SECURITY_INIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 133 | /* .exit.text is discarded at runtime, not link time, to deal with |
| 134 | * references from .rodata |
| 135 | */ |
| 136 | .exit.text : { |
| 137 | *(.exit.text) |
| 138 | } |
| 139 | .exit.data : { |
| 140 | *(.exit.data) |
| 141 | } |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 142 | #if defined(CONFIG_BLK_DEV_INITRD) |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 143 | . = ALIGN(_PAGE_SIZE); |
| 144 | .init.ramfs : { |
| 145 | __initramfs_start = .; |
| 146 | *(.init.ramfs) |
| 147 | __initramfs_end = .; |
| 148 | } |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 149 | #endif |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 150 | PERCPU(_PAGE_SIZE) |
| 151 | . = ALIGN(_PAGE_SIZE); |
| 152 | __init_end = .; |
| 153 | /* freed after init ends here */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 155 | __bss_start = .; /* BSS */ |
| 156 | .sbss : { |
| 157 | *(.sbss) |
| 158 | *(.scommon) |
| 159 | } |
| 160 | .bss : { |
| 161 | *(.bss) |
| 162 | *(COMMON) |
| 163 | } |
| 164 | __bss_stop = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 166 | _end = . ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 168 | /* Sections to be discarded */ |
| 169 | /DISCARD/ : { |
| 170 | *(.exitcall.exit) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 172 | /* ABI crap starts here */ |
| 173 | *(.MIPS.options) |
| 174 | *(.options) |
| 175 | *(.pdr) |
| 176 | *(.reginfo) |
| 177 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 179 | /* These mark the ABI of the kernel for debuggers. */ |
| 180 | .mdebug.abi32 : { |
| 181 | KEEP(*(.mdebug.abi32)) |
| 182 | } |
| 183 | .mdebug.abi64 : { |
| 184 | KEEP(*(.mdebug.abi64)) |
| 185 | } |
Daniel Jacobowitz | 6c76988 | 2007-08-03 11:43:01 -0400 | [diff] [blame] | 186 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 187 | /* This is the MIPS specific mdebug section. */ |
| 188 | .mdebug : { |
| 189 | *(.mdebug) |
| 190 | } |
Atsushi Nemoto | 78665aa | 2006-05-11 00:41:26 +0900 | [diff] [blame] | 191 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 192 | STABS_DEBUG |
| 193 | DWARF_DEBUG |
Atsushi Nemoto | 04b6b3b | 2006-05-10 15:36:04 +0900 | [diff] [blame] | 194 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame^] | 195 | /* These must appear regardless of . */ |
| 196 | .gptab.sdata : { |
| 197 | *(.gptab.data) |
| 198 | *(.gptab.sdata) |
| 199 | } |
| 200 | .gptab.sbss : { |
| 201 | *(.gptab.bss) |
| 202 | *(.gptab.sbss) |
| 203 | } |
| 204 | .note : { |
| 205 | *(.note) |
| 206 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | } |