blob: 33581387d662ec73d9f8b324b7cbccca7d443a2d [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)
Ralf Baechle603bb992007-10-14 22:49:01 +01008PHDRS {
9 text PT_LOAD FLAGS(7); /* RWX */
10 note PT_NOTE FLAGS(4); /* R__ */
11}
Linus Torvalds1da177e2005-04-16 15:20:36 -070012jiffies = JIFFIES;
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020013
Linus Torvalds1da177e2005-04-16 15:20:36 -070014SECTIONS
15{
16#ifdef CONFIG_BOOT_ELF64
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020017 /* Read-only sections, merged into text segment: */
18 /* . = 0xc000000000000000; */
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020020 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
21 /* . = 0xc00000000001c000; */
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020023 /* Set the vaddr for the text segment to a value
24 * >= 0xa800 0000 0001 9000 if no symmon is going to configured
25 * >= 0xa800 0000 0030 0000 otherwise
26 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020028 /* . = 0xa800000000300000; */
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020029 . = 0xffffffff80300000;
Linus Torvalds1da177e2005-04-16 15:20:36 -070030#endif
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020031 . = LOADADDR;
32 /* read-only */
33 _text = .; /* Text and read-only data */
34 .text : {
35 TEXT_TEXT
36 SCHED_TEXT
37 LOCK_TEXT
38 *(.fixup)
39 *(.gnu.warning)
Ralf Baechle603bb992007-10-14 22:49:01 +010040 } :text = 0
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020041 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020043 /* Exception table */
44 . = ALIGN(16);
45 __ex_table : {
46 __start___ex_table = .;
47 *(__ex_table)
48 __stop___ex_table = .;
49 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020051 /* Exception table for data bus errors */
52 __dbe_table : {
53 __start___dbe_table = .;
54 *(__dbe_table)
55 __stop___dbe_table = .;
56 }
Ralf Baechle603bb992007-10-14 22:49:01 +010057
58 NOTES :text :note
59 .dummy : { *(.dummy) } :text
60
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020061 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020063 /* writeable */
64 .data : { /* Data */
65 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
66 /*
67 * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
68 * limits the maximum alignment to at most 32kB and results in the following
69 * warning:
70 *
71 * CC arch/mips/kernel/init_task.o
72 * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
73 * is greater than maximum object file alignment. Using 32768
74 */
75 . = ALIGN(_PAGE_SIZE);
76 *(.data.init_task)
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020078 DATA_DATA
79 CONSTRUCTORS
80 }
81 _gp = . + 0x8000;
82 .lit8 : {
83 *(.lit8)
84 }
85 .lit4 : {
86 *(.lit4)
87 }
88 /* We want the small data sections together, so single-instruction offsets
89 can access them all, and initialized data all before uninitialized, so
90 we can shorten the on-disk segment size. */
91 .sdata : {
92 *(.sdata)
93 }
Maciej W. Rozycki6f6b3942007-10-01 13:24:04 +010094
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020095 . = ALIGN(_PAGE_SIZE);
96 .data_nosave : {
97 __nosave_begin = .;
98 *(.data.nosave)
99 }
100 . = ALIGN(_PAGE_SIZE);
101 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200103 . = ALIGN(32);
104 .data.cacheline_aligned : {
105 *(.data.cacheline_aligned)
106 }
107 _edata = .; /* End of data section */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200109 /* will be freed after init */
110 . = ALIGN(_PAGE_SIZE); /* Init code and data */
111 __init_begin = .;
112 .init.text : {
113 _sinittext = .;
114 *(.init.text)
115 _einittext = .;
116 }
117 .init.data : {
118 *(.init.data)
119 }
120 . = ALIGN(16);
121 .init.setup : {
122 __setup_start = .;
123 *(.init.setup)
124 __setup_end = .;
125 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200127 .initcall.init : {
128 __initcall_start = .;
129 INITCALLS
130 __initcall_end = .;
131 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200133 .con_initcall.init : {
134 __con_initcall_start = .;
135 *(.con_initcall.init)
136 __con_initcall_end = .;
137 }
138 SECURITY_INIT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200140 /* .exit.text is discarded at runtime, not link time, to deal with
141 * references from .rodata
142 */
143 .exit.text : {
144 *(.exit.text)
145 }
146 .exit.data : {
147 *(.exit.data)
148 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800149#if defined(CONFIG_BLK_DEV_INITRD)
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200150 . = ALIGN(_PAGE_SIZE);
151 .init.ramfs : {
152 __initramfs_start = .;
153 *(.init.ramfs)
154 __initramfs_end = .;
155 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800156#endif
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200157 PERCPU(_PAGE_SIZE)
158 . = ALIGN(_PAGE_SIZE);
159 __init_end = .;
160 /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200162 __bss_start = .; /* BSS */
163 .sbss : {
164 *(.sbss)
165 *(.scommon)
166 }
167 .bss : {
168 *(.bss)
169 *(COMMON)
170 }
171 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200173 _end = . ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200175 /* Sections to be discarded */
176 /DISCARD/ : {
177 *(.exitcall.exit)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200179 /* ABI crap starts here */
180 *(.MIPS.options)
181 *(.options)
182 *(.pdr)
183 *(.reginfo)
184 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200186 /* These mark the ABI of the kernel for debuggers. */
187 .mdebug.abi32 : {
188 KEEP(*(.mdebug.abi32))
189 }
190 .mdebug.abi64 : {
191 KEEP(*(.mdebug.abi64))
192 }
Daniel Jacobowitz6c769882007-08-03 11:43:01 -0400193
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200194 /* This is the MIPS specific mdebug section. */
195 .mdebug : {
196 *(.mdebug)
197 }
Atsushi Nemoto78665aa2006-05-11 00:41:26 +0900198
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200199 STABS_DEBUG
200 DWARF_DEBUG
Atsushi Nemoto04b6b3b2006-05-10 15:36:04 +0900201
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200202 /* These must appear regardless of . */
203 .gptab.sdata : {
204 *(.gptab.data)
205 *(.gptab.sdata)
206 }
207 .gptab.sbss : {
208 *(.gptab.bss)
209 *(.gptab.sbss)
210 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211}