blob: 14fa00e3cdfa6007332e58fbd84fc9eba3c4d1ac [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/config.h>
Ralf Baechledbee90b2006-02-02 14:31:16 +00002#include <asm/asm-offsets.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07003#include <asm-generic/vmlinux.lds.h>
4
Ralf Baechle41c594a2006-04-05 09:45:45 +01005#undef mips
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#define mips mips
7OUTPUT_ARCH(mips)
8ENTRY(kernel_entry)
9jiffies = JIFFIES;
10SECTIONS
11{
12#ifdef CONFIG_BOOT_ELF64
13 /* Read-only sections, merged into text segment: */
14 /* . = 0xc000000000000000; */
15
16 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
17 /* . = 0xc00000000001c000; */
18
Ralf Baechle42a3b4f2005-09-03 15:56:17 -070019 /* Set the vaddr for the text segment to a value
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 >= 0xa800 0000 0001 9000 if no symmon is going to configured
21 >= 0xa800 0000 0030 0000 otherwise */
22
23 /* . = 0xa800000000300000; */
24 /* . = 0xa800000000300000; */
25 . = 0xffffffff80300000;
26#endif
27 . = LOADADDR;
28 /* read-only */
29 _text = .; /* Text and read-only data */
30 .text : {
31 *(.text)
32 SCHED_TEXT
33 LOCK_TEXT
34 *(.fixup)
35 *(.gnu.warning)
36 } =0
37
38 _etext = .; /* End of text section */
39
40 . = ALIGN(16); /* Exception table */
41 __start___ex_table = .;
42 __ex_table : { *(__ex_table) }
43 __stop___ex_table = .;
44
45 __start___dbe_table = .; /* Exception table for data bus errors */
46 __dbe_table : { *(__dbe_table) }
47 __stop___dbe_table = .;
48
49 RODATA
50
51 /* writeable */
52 .data : { /* Data */
53 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
54 *(.data.init_task)
55
56 *(.data)
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058 CONSTRUCTORS
59 }
60 _gp = . + 0x8000;
61 .lit8 : { *(.lit8) }
62 .lit4 : { *(.lit4) }
63 /* We want the small data sections together, so single-instruction offsets
64 can access them all, and initialized data all before uninitialized, so
65 we can shorten the on-disk segment size. */
66 .sdata : { *(.sdata) }
67
Ralf Baechledbee90b2006-02-02 14:31:16 +000068 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 __nosave_begin = .;
70 .data_nosave : { *(.data.nosave) }
Ralf Baechledbee90b2006-02-02 14:31:16 +000071 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 __nosave_end = .;
73
74 . = ALIGN(32);
75 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
76
77 _edata = .; /* End of data section */
78
79 /* will be freed after init */
Ralf Baechledbee90b2006-02-02 14:31:16 +000080 . = ALIGN(_PAGE_SIZE); /* Init code and data */
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 __init_begin = .;
82 .init.text : {
83 _sinittext = .;
84 *(.init.text)
85 _einittext = .;
86 }
87 .init.data : { *(.init.data) }
88 . = ALIGN(16);
89 __setup_start = .;
90 .init.setup : { *(.init.setup) }
91 __setup_end = .;
92
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 __initcall_start = .;
94 .initcall.init : {
95 *(.initcall1.init)
96 *(.initcall2.init)
97 *(.initcall3.init)
98 *(.initcall4.init)
99 *(.initcall5.init)
100 *(.initcall6.init)
101 *(.initcall7.init)
102 }
103 __initcall_end = .;
104
105 __con_initcall_start = .;
106 .con_initcall.init : { *(.con_initcall.init) }
107 __con_initcall_end = .;
108 SECURITY_INIT
Ralf Baechlebb7d83f2006-03-08 14:13:04 +0000109 /* .exit.text is discarded at runtime, not link time, to deal with
110 references from .rodata */
111 .exit.text : { *(.exit.text) }
Ralf Baechledbee90b2006-02-02 14:31:16 +0000112 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 __initramfs_start = .;
114 .init.ramfs : { *(.init.ramfs) }
115 __initramfs_end = .;
116 . = ALIGN(32);
117 __per_cpu_start = .;
118 .data.percpu : { *(.data.percpu) }
119 __per_cpu_end = .;
Ralf Baechledbee90b2006-02-02 14:31:16 +0000120 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 __init_end = .;
122 /* freed after init ends here */
123
124 __bss_start = .; /* BSS */
125 .sbss : {
126 *(.sbss)
127 *(.scommon)
128 }
129 .bss : {
130 *(.bss)
131 *(COMMON)
132 }
133 __bss_stop = .;
134
135 _end = . ;
136
137 /* Sections to be discarded */
138 /DISCARD/ : {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 *(.exit.data)
140 *(.exitcall.exit)
141
142 /* ABI crap starts here */
143 *(.comment)
144 *(.MIPS.options)
145 *(.note)
146 *(.options)
147 *(.pdr)
148 *(.reginfo)
149 *(.mdebug*)
150 }
151
152 /* This is the MIPS specific mdebug section. */
153 .mdebug : { *(.mdebug) }
154 /* These are needed for ELF backends which have not yet been
155 converted to the new style linker. */
156 .stab 0 : { *(.stab) }
157 .stabstr 0 : { *(.stabstr) }
158 /* DWARF debug sections.
159 Symbols in the .debug DWARF section are relative to the beginning of the
160 section so we begin .debug at 0. It's not clear yet what needs to happen
161 for the others. */
162 .debug 0 : { *(.debug) }
163 .debug_srcinfo 0 : { *(.debug_srcinfo) }
164 .debug_aranges 0 : { *(.debug_aranges) }
165 .debug_pubnames 0 : { *(.debug_pubnames) }
166 .debug_sfnames 0 : { *(.debug_sfnames) }
167 .line 0 : { *(.line) }
168 /* These must appear regardless of . */
169 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
170 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
171 .comment : { *(.comment) }
172 .note : { *(.note) }
173}