blob: 84f9a4cc6f2fe20b2ea4df6b637da31f3d082302 [file] [log] [blame]
Ralf Baechledbee90b2006-02-02 14:31:16 +00001#include <asm/asm-offsets.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#include <asm-generic/vmlinux.lds.h>
3
Ralf Baechle41c594a2006-04-05 09:45:45 +01004#undef mips
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#define mips mips
6OUTPUT_ARCH(mips)
7ENTRY(kernel_entry)
8jiffies = JIFFIES;
Sam Ravnborg0f5c9062007-09-15 23:35:53 +02009
Linus Torvalds1da177e2005-04-16 15:20:36 -070010SECTIONS
11{
12#ifdef CONFIG_BOOT_ELF64
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020013 /* Read-only sections, merged into text segment: */
14 /* . = 0xc000000000000000; */
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020016 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
17 /* . = 0xc00000000001c000; */
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020019 /* 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 Torvalds1da177e2005-04-16 15:20:36 -070023
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020024 /* . = 0xa800000000300000; */
25 /* . = 0xa800000000300000; */
26 . = 0xffffffff80300000;
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#endif
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020028 . = 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 Torvalds1da177e2005-04-16 15:20:36 -070039
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020040 /* Exception table */
41 . = ALIGN(16);
42 __ex_table : {
43 __start___ex_table = .;
44 *(__ex_table)
45 __stop___ex_table = .;
46 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020048 /* Exception table for data bus errors */
49 __dbe_table : {
50 __start___dbe_table = .;
51 *(__dbe_table)
52 __stop___dbe_table = .;
53 }
54 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070055
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020056 /* 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 Torvalds1da177e2005-04-16 15:20:36 -070070
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020071 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. Rozycki6f6b3942007-10-01 13:24:04 +010087
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020088 . = ALIGN(_PAGE_SIZE);
89 .data_nosave : {
90 __nosave_begin = .;
91 *(.data.nosave)
92 }
93 . = ALIGN(_PAGE_SIZE);
94 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070095
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020096 . = ALIGN(32);
97 .data.cacheline_aligned : {
98 *(.data.cacheline_aligned)
99 }
100 _edata = .; /* End of data section */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200102 /* 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 Torvalds1da177e2005-04-16 15:20:36 -0700119
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200120 .initcall.init : {
121 __initcall_start = .;
122 INITCALLS
123 __initcall_end = .;
124 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200126 .con_initcall.init : {
127 __con_initcall_start = .;
128 *(.con_initcall.init)
129 __con_initcall_end = .;
130 }
131 SECURITY_INIT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200133 /* .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 Saman67d38222007-02-10 01:44:44 -0800142#if defined(CONFIG_BLK_DEV_INITRD)
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200143 . = ALIGN(_PAGE_SIZE);
144 .init.ramfs : {
145 __initramfs_start = .;
146 *(.init.ramfs)
147 __initramfs_end = .;
148 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800149#endif
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200150 PERCPU(_PAGE_SIZE)
151 . = ALIGN(_PAGE_SIZE);
152 __init_end = .;
153 /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200155 __bss_start = .; /* BSS */
156 .sbss : {
157 *(.sbss)
158 *(.scommon)
159 }
160 .bss : {
161 *(.bss)
162 *(COMMON)
163 }
164 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200166 _end = . ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200168 /* Sections to be discarded */
169 /DISCARD/ : {
170 *(.exitcall.exit)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200172 /* ABI crap starts here */
173 *(.MIPS.options)
174 *(.options)
175 *(.pdr)
176 *(.reginfo)
177 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200179 /* 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 Jacobowitz6c769882007-08-03 11:43:01 -0400186
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200187 /* This is the MIPS specific mdebug section. */
188 .mdebug : {
189 *(.mdebug)
190 }
Atsushi Nemoto78665aa2006-05-11 00:41:26 +0900191
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200192 STABS_DEBUG
193 DWARF_DEBUG
Atsushi Nemoto04b6b3b2006-05-10 15:36:04 +0900194
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200195 /* 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 Torvalds1da177e2005-04-16 15:20:36 -0700207}