blob: b5470ceb418b301847f385d72e306eff0b1bf6dc [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
Ralf Baechlef70fd1b2007-10-14 22:50:05 +010038 KPROBES_TEXT
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020039 *(.fixup)
40 *(.gnu.warning)
Ralf Baechle603bb992007-10-14 22:49:01 +010041 } :text = 0
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020042 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020044 /* Exception table */
45 . = ALIGN(16);
46 __ex_table : {
47 __start___ex_table = .;
48 *(__ex_table)
49 __stop___ex_table = .;
50 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020052 /* Exception table for data bus errors */
53 __dbe_table : {
54 __start___dbe_table = .;
55 *(__dbe_table)
56 __stop___dbe_table = .;
57 }
Ralf Baechle603bb992007-10-14 22:49:01 +010058
59 NOTES :text :note
60 .dummy : { *(.dummy) } :text
61
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020062 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020064 /* writeable */
65 .data : { /* Data */
Franck Bui-Huu16be2432007-10-18 23:12:32 +020066 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
67 /*
68 * This ALIGN is needed as a workaround for a bug a
69 * gcc bug upto 4.1 which limits the maximum alignment
70 * to at most 32kB and results in the following
71 * warning:
72 *
73 * CC arch/mips/kernel/init_task.o
74 * arch/mips/kernel/init_task.c:30: warning: alignment
75 * of ‘init_thread_union’ is greater than maximum
76 * object file alignment. Using 32768
77 */
78 . = ALIGN(_PAGE_SIZE);
79 *(.data.init_task)
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
Franck Bui-Huu16be2432007-10-18 23:12:32 +020081 DATA_DATA
82 CONSTRUCTORS
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020083 }
84 _gp = . + 0x8000;
85 .lit8 : {
86 *(.lit8)
87 }
88 .lit4 : {
89 *(.lit4)
90 }
91 /* We want the small data sections together, so single-instruction offsets
92 can access them all, and initialized data all before uninitialized, so
93 we can shorten the on-disk segment size. */
94 .sdata : {
95 *(.sdata)
96 }
Maciej W. Rozycki6f6b3942007-10-01 13:24:04 +010097
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020098 . = ALIGN(_PAGE_SIZE);
99 .data_nosave : {
100 __nosave_begin = .;
101 *(.data.nosave)
102 }
103 . = ALIGN(_PAGE_SIZE);
104 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200106 . = ALIGN(32);
107 .data.cacheline_aligned : {
108 *(.data.cacheline_aligned)
109 }
110 _edata = .; /* End of data section */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200112 /* will be freed after init */
113 . = ALIGN(_PAGE_SIZE); /* Init code and data */
114 __init_begin = .;
115 .init.text : {
116 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100117 INIT_TEXT
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200118 _einittext = .;
119 }
120 .init.data : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100121 INIT_DATA
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200122 }
123 . = ALIGN(16);
124 .init.setup : {
125 __setup_start = .;
126 *(.init.setup)
127 __setup_end = .;
128 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200130 .initcall.init : {
131 __initcall_start = .;
132 INITCALLS
133 __initcall_end = .;
134 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200136 .con_initcall.init : {
137 __con_initcall_start = .;
138 *(.con_initcall.init)
139 __con_initcall_end = .;
140 }
141 SECURITY_INIT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200143 /* .exit.text is discarded at runtime, not link time, to deal with
144 * references from .rodata
145 */
146 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100147 EXIT_TEXT
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200148 }
149 .exit.data : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100150 EXIT_DATA
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200151 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800152#if defined(CONFIG_BLK_DEV_INITRD)
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200153 . = ALIGN(_PAGE_SIZE);
154 .init.ramfs : {
155 __initramfs_start = .;
156 *(.init.ramfs)
157 __initramfs_end = .;
158 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800159#endif
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200160 PERCPU(_PAGE_SIZE)
161 . = ALIGN(_PAGE_SIZE);
162 __init_end = .;
163 /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200165 __bss_start = .; /* BSS */
166 .sbss : {
167 *(.sbss)
168 *(.scommon)
169 }
170 .bss : {
171 *(.bss)
172 *(COMMON)
173 }
174 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200176 _end = . ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200178 /* Sections to be discarded */
179 /DISCARD/ : {
180 *(.exitcall.exit)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200182 /* ABI crap starts here */
183 *(.MIPS.options)
184 *(.options)
185 *(.pdr)
186 *(.reginfo)
187 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200189 /* These mark the ABI of the kernel for debuggers. */
190 .mdebug.abi32 : {
191 KEEP(*(.mdebug.abi32))
192 }
193 .mdebug.abi64 : {
194 KEEP(*(.mdebug.abi64))
195 }
Daniel Jacobowitz6c769882007-08-03 11:43:01 -0400196
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200197 /* This is the MIPS specific mdebug section. */
198 .mdebug : {
199 *(.mdebug)
200 }
Atsushi Nemoto78665aa2006-05-11 00:41:26 +0900201
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200202 STABS_DEBUG
203 DWARF_DEBUG
Atsushi Nemoto04b6b3b2006-05-10 15:36:04 +0900204
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200205 /* These must appear regardless of . */
206 .gptab.sdata : {
207 *(.gptab.data)
208 *(.gptab.sdata)
209 }
210 .gptab.sbss : {
211 *(.gptab.bss)
212 *(.gptab.sbss)
213 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214}