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 | |
14 | ifdef CONFIG_32BIT | ||||
15 | ifdef CONFIG_CPU_LITTLE_ENDIAN | ||||
16 | jiffies = jiffies_64; | ||||
17 | else | ||||
18 | jiffies = jiffies_64 + 4; | ||||
19 | endif | ||||
20 | else | ||||
21 | jiffies = jiffies_64; | ||||
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 |
Atsushi Nemoto | 6b3766a | 2008-08-05 23:45:14 +0900 | [diff] [blame] | 49 | *(.text.*) |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 50 | *(.fixup) |
51 | *(.gnu.warning) | ||||
Ralf Baechle | 603bb99 | 2007-10-14 22:49:01 +0100 | [diff] [blame] | 52 | } :text = 0 |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 53 | _etext = .; /* End of text section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 55 | EXCEPTION_TABLE(16) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 57 | /* Exception table for data bus errors */ |
58 | __dbe_table : { | ||||
59 | __start___dbe_table = .; | ||||
60 | *(__dbe_table) | ||||
61 | __stop___dbe_table = .; | ||||
62 | } | ||||
Ralf Baechle | 603bb99 | 2007-10-14 22:49:01 +0100 | [diff] [blame] | 63 | |
64 | NOTES :text :note | ||||
65 | .dummy : { *(.dummy) } :text | ||||
66 | |||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 67 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 69 | /* writeable */ |
70 | .data : { /* Data */ | ||||
Franck Bui-Huu | 16be243 | 2007-10-18 23:12:32 +0200 | [diff] [blame] | 71 | . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 73 | INIT_TASK_DATA(PAGE_SIZE) |
74 | NOSAVE_DATA | ||||
75 | CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) | ||||
Franck Bui-Huu | 16be243 | 2007-10-18 23:12:32 +0200 | [diff] [blame] | 76 | DATA_DATA |
77 | CONSTRUCTORS | ||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 78 | } |
79 | _gp = . + 0x8000; | ||||
80 | .lit8 : { | ||||
81 | *(.lit8) | ||||
82 | } | ||||
83 | .lit4 : { | ||||
84 | *(.lit4) | ||||
85 | } | ||||
86 | /* We want the small data sections together, so single-instruction offsets | ||||
87 | can access them all, and initialized data all before uninitialized, so | ||||
88 | we can shorten the on-disk segment size. */ | ||||
89 | .sdata : { | ||||
90 | *(.sdata) | ||||
91 | } | ||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 92 | _edata = .; /* End of data section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 94 | /* will be freed after init */ |
Nelson Elhage | a0b54e2 | 2009-07-31 16:58:18 -0400 | [diff] [blame] | 95 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 96 | __init_begin = .; |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 97 | INIT_TEXT_SECTION(PAGE_SIZE) |
98 | INIT_DATA_SECTION(16) | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 100 | /* .exit.text is discarded at runtime, not link time, to deal with |
101 | * references from .rodata | ||||
102 | */ | ||||
103 | .exit.text : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 104 | EXIT_TEXT |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 105 | } |
106 | .exit.data : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 107 | EXIT_DATA |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 108 | } |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 109 | |
Nelson Elhage | a0b54e2 | 2009-07-31 16:58:18 -0400 | [diff] [blame] | 110 | PERCPU(PAGE_SIZE) |
111 | . = ALIGN(PAGE_SIZE); | ||||
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 112 | __init_end = .; |
113 | /* freed after init ends here */ | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | |
Nelson Elhage | 6eb10bc | 2009-07-31 16:58:19 -0400 | [diff] [blame] | 115 | BSS_SECTION(0, 0, 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 117 | _end = . ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 119 | /* These mark the ABI of the kernel for debuggers. */ |
120 | .mdebug.abi32 : { | ||||
121 | KEEP(*(.mdebug.abi32)) | ||||
122 | } | ||||
123 | .mdebug.abi64 : { | ||||
124 | KEEP(*(.mdebug.abi64)) | ||||
125 | } | ||||
Daniel Jacobowitz | 6c76988 | 2007-08-03 11:43:01 -0400 | [diff] [blame] | 126 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 127 | /* This is the MIPS specific mdebug section. */ |
128 | .mdebug : { | ||||
129 | *(.mdebug) | ||||
130 | } | ||||
Atsushi Nemoto | 78665aa | 2006-05-11 00:41:26 +0900 | [diff] [blame] | 131 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 132 | STABS_DEBUG |
133 | DWARF_DEBUG | ||||
Atsushi Nemoto | 04b6b3b | 2006-05-10 15:36:04 +0900 | [diff] [blame] | 134 | |
Sam Ravnborg | 0f5c906 | 2007-09-15 23:35:53 +0200 | [diff] [blame] | 135 | /* These must appear regardless of . */ |
136 | .gptab.sdata : { | ||||
137 | *(.gptab.data) | ||||
138 | *(.gptab.sdata) | ||||
139 | } | ||||
140 | .gptab.sbss : { | ||||
141 | *(.gptab.bss) | ||||
142 | *(.gptab.sbss) | ||||
143 | } | ||||
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 144 | |
145 | /* Sections to be discarded */ | ||||
146 | DISCARDS | ||||
147 | /DISCARD/ : { | ||||
148 | /* ABI crap starts here */ | ||||
149 | *(.MIPS.options) | ||||
150 | *(.options) | ||||
151 | *(.pdr) | ||||
152 | *(.reginfo) | ||||
153 | } | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | } |