Ralf Baechle | dbee90b | 2006-02-02 14:31:16 +0000 | [diff] [blame] | 1 | #include <asm/asm-offsets.h> |
Nelson Elhage | a0b54e2 | 2009-07-31 16:58:18 -0400 | [diff] [blame] | 2 | #include <asm/page.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | #include <asm-generic/vmlinux.lds.h> |
4 | |||||
Ralf Baechle | 41c594a | 2006-04-05 09:45:45 +0100 | [diff] [blame] | 5 | #undef mips |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | #define mips mips |
7 | OUTPUT_ARCH(mips) | ||||
8 | ENTRY(kernel_entry) | ||||
Ralf Baechle | 603bb99 | 2007-10-14 22:49:01 +0100 | [diff] [blame] | 9 | PHDRS { |
10 | text PT_LOAD FLAGS(7); /* RWX */ | ||||
11 | note PT_NOTE FLAGS(4); /* R__ */ | ||||
12 | } | ||||
Sam Ravnborg | 51b563f | 2009-09-20 12:28:22 +0200 | [diff] [blame] | 13 | |
Manuel Lauss | d71789b | 2009-09-24 21:44:24 +0200 | [diff] [blame] | 14 | #ifdef CONFIG_32BIT |
15 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||||
Sam Ravnborg | 51b563f | 2009-09-20 12:28:22 +0200 | [diff] [blame] | 16 | jiffies = jiffies_64; |
Manuel Lauss | d71789b | 2009-09-24 21:44:24 +0200 | [diff] [blame] | 17 | #else |
Sam Ravnborg | 51b563f | 2009-09-20 12:28:22 +0200 | [diff] [blame] | 18 | jiffies = jiffies_64 + 4; |
Manuel Lauss | d71789b | 2009-09-24 21:44:24 +0200 | [diff] [blame] | 19 | #endif |
20 | #else | ||||
Sam Ravnborg | 51b563f | 2009-09-20 12:28:22 +0200 | [diff] [blame] | 21 | jiffies = jiffies_64; |
Manuel Lauss | d71789b | 2009-09-24 21:44:24 +0200 | [diff] [blame] | 22 | #endif |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | SECTIONS |
25 | { | ||||
26 | #ifdef CONFIG_BOOT_ELF64 | ||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 27 | /* Read-only sections, merged into text segment: */ |
28 | /* . = 0xc000000000000000; */ | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 30 | /* This is the value for an Origin kernel, taken from an IRIX kernel. */ |
31 | /* . = 0xc00000000001c000; */ | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 33 | /* Set the vaddr for the text segment to a value |
34 | * >= 0xa800 0000 0001 9000 if no symmon is going to configured | ||||
35 | * >= 0xa800 0000 0030 0000 otherwise | ||||
36 | */ | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 38 | /* . = 0xa800000000300000; */ |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 39 | . = 0xffffffff80300000; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #endif |
Sam Ravnborg | 51b563f | 2009-09-20 12:28:22 +0200 | [diff] [blame] | 41 | . = VMLINUX_LOAD_ADDRESS; |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 42 | /* read-only */ |
43 | _text = .; /* Text and read-only data */ | ||||
44 | .text : { | ||||
45 | TEXT_TEXT | ||||
46 | SCHED_TEXT | ||||
47 | LOCK_TEXT | ||||
Ralf Baechle | f70fd1b | 2007-10-14 22:50:05 +0100 | [diff] [blame] | 48 | KPROBES_TEXT |
Wu Zhangjin | 8f99a16 | 2009-11-20 20:34:33 +0800 | [diff] [blame^] | 49 | IRQENTRY_TEXT |
Atsushi Nemoto | 6b3766a | 2008-08-05 23:45:14 +0900 | [diff] [blame] | 50 | *(.text.*) |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 51 | *(.fixup) |
52 | *(.gnu.warning) | ||||
Ralf Baechle | 603bb99 | 2007-10-14 22:49:01 +0100 | [diff] [blame] | 53 | } :text = 0 |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 54 | _etext = .; /* End of text section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 56 | EXCEPTION_TABLE(16) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 58 | /* Exception table for data bus errors */ |
59 | __dbe_table : { | ||||
60 | __start___dbe_table = .; | ||||
61 | *(__dbe_table) | ||||
62 | __stop___dbe_table = .; | ||||
63 | } | ||||
Ralf Baechle | 603bb99 | 2007-10-14 22:49:01 +0100 | [diff] [blame] | 64 | |
65 | NOTES :text :note | ||||
66 | .dummy : { *(.dummy) } :text | ||||
67 | |||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 68 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 70 | /* writeable */ |
71 | .data : { /* Data */ | ||||
Franck Bui-Huu | 16be243 | 2007-10-18 23:12:32 +0200 | [diff] [blame] | 72 | . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 74 | INIT_TASK_DATA(PAGE_SIZE) |
75 | NOSAVE_DATA | ||||
76 | CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) | ||||
Franck Bui-Huu | 16be243 | 2007-10-18 23:12:32 +0200 | [diff] [blame] | 77 | DATA_DATA |
78 | CONSTRUCTORS | ||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 79 | } |
80 | _gp = . + 0x8000; | ||||
81 | .lit8 : { | ||||
82 | *(.lit8) | ||||
83 | } | ||||
84 | .lit4 : { | ||||
85 | *(.lit4) | ||||
86 | } | ||||
87 | /* We want the small data sections together, so single-instruction offsets | ||||
88 | can access them all, and initialized data all before uninitialized, so | ||||
89 | we can shorten the on-disk segment size. */ | ||||
90 | .sdata : { | ||||
91 | *(.sdata) | ||||
92 | } | ||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 93 | _edata = .; /* End of data section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 95 | /* will be freed after init */ |
Nelson Elhage | a0b54e2 | 2009-07-31 16:58:18 -0400 | [diff] [blame] | 96 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 97 | __init_begin = .; |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 98 | INIT_TEXT_SECTION(PAGE_SIZE) |
99 | INIT_DATA_SECTION(16) | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 101 | /* .exit.text is discarded at runtime, not link time, to deal with |
102 | * references from .rodata | ||||
103 | */ | ||||
104 | .exit.text : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 105 | EXIT_TEXT |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 106 | } |
107 | .exit.data : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 108 | EXIT_DATA |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 109 | } |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 110 | |
Nelson Elhage | a0b54e2 | 2009-07-31 16:58:18 -0400 | [diff] [blame] | 111 | PERCPU(PAGE_SIZE) |
112 | . = ALIGN(PAGE_SIZE); | ||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 113 | __init_end = .; |
114 | /* freed after init ends here */ | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 116 | BSS_SECTION(0, 0, 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 118 | _end = . ; |
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 | /* These mark the ABI of the kernel for debuggers. */ |
121 | .mdebug.abi32 : { | ||||
122 | KEEP(*(.mdebug.abi32)) | ||||
123 | } | ||||
124 | .mdebug.abi64 : { | ||||
125 | KEEP(*(.mdebug.abi64)) | ||||
126 | } | ||||
Daniel Jacobowitz | 6c76988 | 2007-08-03 11:43:01 -0400 | [diff] [blame] | 127 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 128 | /* This is the MIPS specific mdebug section. */ |
129 | .mdebug : { | ||||
130 | *(.mdebug) | ||||
131 | } | ||||
Atsushi Nemoto | 78665aa | 2006-05-11 00:41:26 +0900 | [diff] [blame] | 132 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 133 | STABS_DEBUG |
134 | DWARF_DEBUG | ||||
Atsushi Nemoto | 04b6b3b | 2006-05-10 15:36:04 +0900 | [diff] [blame] | 135 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 136 | /* These must appear regardless of . */ |
137 | .gptab.sdata : { | ||||
138 | *(.gptab.data) | ||||
139 | *(.gptab.sdata) | ||||
140 | } | ||||
141 | .gptab.sbss : { | ||||
142 | *(.gptab.bss) | ||||
143 | *(.gptab.sbss) | ||||
144 | } | ||||
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 145 | |
146 | /* Sections to be discarded */ | ||||
147 | DISCARDS | ||||
148 | /DISCARD/ : { | ||||
149 | /* ABI crap starts here */ | ||||
150 | *(.MIPS.options) | ||||
151 | *(.options) | ||||
152 | *(.pdr) | ||||
153 | *(.reginfo) | ||||
154 | } | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | } |