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