1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#include <asm-generic/vmlinux.lds.h>
18#include <asm/page.h>
19#include <asm/thread_info.h>
20
21#include <variant/core.h>
22#include <platform/hardware.h>
23OUTPUT_ARCH(xtensa)
24ENTRY(_start)
25
26#ifdef __XTENSA_EB__
27jiffies = jiffies_64 + 4;
28#else
29jiffies = jiffies_64;
30#endif
31
32#ifndef KERNELOFFSET
33#define KERNELOFFSET 0xd0001000
34#endif
35
36
37
38
39
40
41
42
43
44
45
46#define RELOCATE_ENTRY(sym, section) \
47 LONG(sym
48 LONG(sym
49 LONG(LOADADDR(section))
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65#define SECTION_VECTOR(sym, section, addr, max_prevsec_size, prevsec) \
66 section addr : AT((MIN(LOADADDR(prevsec) + max_prevsec_size, \
67 LOADADDR(prevsec) + SIZEOF(prevsec)) + 3) & ~ 3) \
68 { \
69 . = ALIGN(4); \
70 sym
71 *(section) \
72 sym
73 }
74
75
76
77
78
79SECTIONS
80{
81 . = KERNELOFFSET;
82
83
84 _text = .;
85 _stext = .;
86 _ftext = .;
87
88 .text :
89 {
90
91 HEAD_TEXT
92 TEXT_TEXT
93 VMLINUX_SYMBOL(__sched_text_start) = .;
94 *(.sched.literal .sched.text)
95 VMLINUX_SYMBOL(__sched_text_end) = .;
96 VMLINUX_SYMBOL(__lock_text_start) = .;
97 *(.spinlock.literal .spinlock.text)
98 VMLINUX_SYMBOL(__lock_text_end) = .;
99
100 }
101 _etext = .;
102 PROVIDE (etext = .);
103
104 . = ALIGN(16);
105
106 RODATA
107
108
109
110 .fixup : { *(.fixup) }
111
112 EXCEPTION_TABLE(16)
113
114
115 _fdata = .;
116 RW_DATA_SECTION(XCHAL_ICACHE_LINESIZE, PAGE_SIZE, THREAD_SIZE)
117 _edata = .;
118
119
120
121 . = ALIGN(PAGE_SIZE);
122 __init_begin = .;
123 INIT_TEXT_SECTION(PAGE_SIZE)
124
125 .init.data :
126 {
127 INIT_DATA
128 . = ALIGN(0x4);
129 __tagtable_begin = .;
130 *(.taglist)
131 __tagtable_end = .;
132
133 . = ALIGN(16);
134 __boot_reloc_table_start = ABSOLUTE(.);
135
136 RELOCATE_ENTRY(_WindowVectors_text,
137 .WindowVectors.text);
138 RELOCATE_ENTRY(_KernelExceptionVector_text,
139 .KernelExceptionVector.text);
140 RELOCATE_ENTRY(_UserExceptionVector_text,
141 .UserExceptionVector.text);
142 RELOCATE_ENTRY(_DoubleExceptionVector_literal,
143 .DoubleExceptionVector.literal);
144 RELOCATE_ENTRY(_DoubleExceptionVector_text,
145 .DoubleExceptionVector.text);
146 RELOCATE_ENTRY(_DebugInterruptVector_text,
147 .DebugInterruptVector.text);
148
149 __boot_reloc_table_end = ABSOLUTE(.) ;
150
151 INIT_SETUP(XCHAL_ICACHE_LINESIZE)
152 INIT_CALLS
153 CON_INITCALL
154 SECURITY_INITCALL
155 INIT_RAM_FS
156 }
157
158 PERCPU(PAGE_SIZE)
159
160
161
162 . = ALIGN(4);
163 .dummy : { LONG(0) }
164
165
166
167 SECTION_VECTOR (_WindowVectors_text,
168 .WindowVectors.text,
169 XCHAL_WINDOW_VECTORS_VADDR, 4,
170 .dummy)
171 SECTION_VECTOR (_DebugInterruptVector_literal,
172 .DebugInterruptVector.literal,
173 XCHAL_DEBUG_VECTOR_VADDR - 4,
174 SIZEOF(.WindowVectors.text),
175 .WindowVectors.text)
176 SECTION_VECTOR (_DebugInterruptVector_text,
177 .DebugInterruptVector.text,
178 XCHAL_DEBUG_VECTOR_VADDR,
179 4,
180 .DebugInterruptVector.literal)
181 SECTION_VECTOR (_KernelExceptionVector_literal,
182 .KernelExceptionVector.literal,
183 XCHAL_KERNEL_VECTOR_VADDR - 4,
184 SIZEOF(.DebugInterruptVector.text),
185 .DebugInterruptVector.text)
186 SECTION_VECTOR (_KernelExceptionVector_text,
187 .KernelExceptionVector.text,
188 XCHAL_KERNEL_VECTOR_VADDR,
189 4,
190 .KernelExceptionVector.literal)
191 SECTION_VECTOR (_UserExceptionVector_literal,
192 .UserExceptionVector.literal,
193 XCHAL_USER_VECTOR_VADDR - 4,
194 SIZEOF(.KernelExceptionVector.text),
195 .KernelExceptionVector.text)
196 SECTION_VECTOR (_UserExceptionVector_text,
197 .UserExceptionVector.text,
198 XCHAL_USER_VECTOR_VADDR,
199 4,
200 .UserExceptionVector.literal)
201 SECTION_VECTOR (_DoubleExceptionVector_literal,
202 .DoubleExceptionVector.literal,
203 XCHAL_DOUBLEEXC_VECTOR_VADDR - 16,
204 SIZEOF(.UserExceptionVector.text),
205 .UserExceptionVector.text)
206 SECTION_VECTOR (_DoubleExceptionVector_text,
207 .DoubleExceptionVector.text,
208 XCHAL_DOUBLEEXC_VECTOR_VADDR,
209 32,
210 .DoubleExceptionVector.literal)
211
212 . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;
213 . = ALIGN(PAGE_SIZE);
214
215 __init_end = .;
216
217 BSS_SECTION(0, 8192, 0)
218
219 _end = .;
220
221
222
223 . = ALIGN(0x10);
224 .bootstrap : { *(.bootstrap.literal .bootstrap.text .bootstrap.data) }
225
226 . = ALIGN(0x1000);
227 __initrd_start = .;
228 .initrd : { *(.initrd) }
229 __initrd_end = .;
230
231 .ResetVector.text XCHAL_RESET_VECTOR_VADDR :
232 {
233 *(.ResetVector.text)
234 }
235
236 .xt.lit : { *(.xt.lit) }
237 .xt.prop : { *(.xt.prop) }
238
239 .debug 0 : { *(.debug) }
240 .line 0 : { *(.line) }
241 .debug_srcinfo 0 : { *(.debug_srcinfo) }
242 .debug_sfnames 0 : { *(.debug_sfnames) }
243 .debug_aranges 0 : { *(.debug_aranges) }
244 .debug_pubnames 0 : { *(.debug_pubnames) }
245 .debug_info 0 : { *(.debug_info) }
246 .debug_abbrev 0 : { *(.debug_abbrev) }
247 .debug_line 0 : { *(.debug_line) }
248 .debug_frame 0 : { *(.debug_frame) }
249 .debug_str 0 : { *(.debug_str) }
250 .debug_loc 0 : { *(.debug_loc) }
251 .debug_macinfo 0 : { *(.debug_macinfo) }
252 .debug_weaknames 0 : { *(.debug_weaknames) }
253 .debug_funcnames 0 : { *(.debug_funcnames) }
254 .debug_typenames 0 : { *(.debug_typenames) }
255 .debug_varnames 0 : { *(.debug_varnames) }
256
257 .xt.insn 0 :
258 {
259 *(.xt.insn)
260 *(.gnu.linkonce.x*)
261 }
262
263 .xt.lit 0 :
264 {
265 *(.xt.lit)
266 *(.gnu.linkonce.p*)
267 }
268
269
270 DISCARDS
271 /DISCARD/ : { *(.exit.literal) }
272}
273