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