-
Notifications
You must be signed in to change notification settings - Fork 14
/
link.ld
391 lines (352 loc) · 10.8 KB
/
link.ld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
/* This linker script generated from xt-genldscripts.tpp for LSP min-rt */
/* Linker Script for default link */
MEMORY
{
iram0_1_seg : org = 0x00400000, len = 0x1000
iram0_2_seg : org = 0x00401000, len = 0x17C
iram0_3_seg : org = 0x00401178, len = 0x20
iram0_4_seg : org = 0x00401198, len = 0x20
iram0_5_seg : org = 0x004011B8, len = 0x20
iram0_6_seg : org = 0x004011D8, len = 0x20
iram0_7_seg : org = 0x004011F8, len = 0x20
iram0_8_seg : org = 0x00401218, len = 0x20
iram0_9_seg : org = 0x00401238, len = 0xEDC4
ddr1_0_seg : org = 0x40900000, len = 0x400000
}
PHDRS
{
iram0_1_phdr PT_LOAD;
iram0_2_phdr PT_LOAD;
iram0_3_phdr PT_LOAD;
iram0_4_phdr PT_LOAD;
iram0_5_phdr PT_LOAD;
iram0_6_phdr PT_LOAD;
iram0_7_phdr PT_LOAD;
iram0_8_phdr PT_LOAD;
iram0_9_phdr PT_LOAD;
ddr1_0_phdr PT_LOAD;
}
/* Default entry point: */
ENTRY(_ResetVector)
/* Memory boundary addresses: */
_memmap_seg_iram0_0_start = 0x400000;
_memmap_seg_iram0_0_max = 0x410000;
_memmap_mem_ddr1_start = 0x37900000;
_memmap_mem_ddr1_end = 0x37b00000;
/* Memory segment boundary addresses: */
_rom_store_table = 0;
PROVIDE(_memmap_reset_vector = 0x400000);
PROVIDE(_memmap_vecbase_reset = 0x401000);
/* Various memory-map dependent cache attribute settings: */
_memmap_cacheattr_wb_base = 0x00000042;
_memmap_cacheattr_wt_base = 0x00000012;
_memmap_cacheattr_bp_base = 0x00000022;
_memmap_cacheattr_unused_mask = 0xFFFFFF00;
_memmap_cacheattr_wb_trapnull = 0x22222242;
_memmap_cacheattr_wba_trapnull = 0x22222242;
_memmap_cacheattr_wbna_trapnull = 0x22222252;
_memmap_cacheattr_wt_trapnull = 0x22222212;
_memmap_cacheattr_bp_trapnull = 0x22222222;
_memmap_cacheattr_wb_strict = 0xFFFFFF42;
_memmap_cacheattr_wt_strict = 0xFFFFFF12;
_memmap_cacheattr_bp_strict = 0xFFFFFF22;
_memmap_cacheattr_wb_allvalid = 0x22222242;
_memmap_cacheattr_wt_allvalid = 0x22222212;
_memmap_cacheattr_bp_allvalid = 0x22222222;
_memmap_region_map = 0x00000003;
PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull);
SECTIONS
{
.ResetVector.text : ALIGN(4)
{
_ResetVector_text_start = ABSOLUTE(.);
KEEP (*(.ResetVector.text))
. = ALIGN (4);
_ResetVector_text_end = ABSOLUTE(.);
} >iram0_1_seg :iram0_1_phdr
.ResetHandler.text : ALIGN(4)
{
_ResetHandler_text_start = ABSOLUTE(.);
*(.ResetHandler.literal .ResetHandler.text)
. = ALIGN (4);
_ResetHandler_text_end = ABSOLUTE(.);
} >iram0_1_seg :iram0_1_phdr
.WindowVectors.text : ALIGN(256)
{
_WindowVectors_text_start = ABSOLUTE(.);
KEEP (*(.WindowVectors.text))
. = ALIGN (4);
_WindowVectors_text_end = ABSOLUTE(.);
} >iram0_2_seg :iram0_2_phdr
.Level2InterruptVector.literal : ALIGN(4)
{
_Level2InterruptVector_literal_start = ABSOLUTE(.);
*(.Level2InterruptVector.literal)
. = ALIGN (4);
_Level2InterruptVector_literal_end = ABSOLUTE(.);
} >iram0_2_seg :iram0_2_phdr
.Level2InterruptVector.text : ALIGN(4)
{
_Level2InterruptVector_text_start = ABSOLUTE(.);
KEEP (*(.Level2InterruptVector.text))
. = ALIGN (4);
_Level2InterruptVector_text_end = ABSOLUTE(.);
} >iram0_3_seg :iram0_3_phdr
.Level3InterruptVector.literal : ALIGN(4)
{
_Level3InterruptVector_literal_start = ABSOLUTE(.);
*(.Level3InterruptVector.literal)
. = ALIGN (4);
_Level3InterruptVector_literal_end = ABSOLUTE(.);
} >iram0_3_seg :iram0_3_phdr
.Level3InterruptVector.text : ALIGN(4)
{
_Level3InterruptVector_text_start = ABSOLUTE(.);
KEEP (*(.Level3InterruptVector.text))
. = ALIGN (4);
_Level3InterruptVector_text_end = ABSOLUTE(.);
} >iram0_4_seg :iram0_4_phdr
.DebugExceptionVector.literal : ALIGN(4)
{
_DebugExceptionVector_literal_start = ABSOLUTE(.);
*(.DebugExceptionVector.literal)
. = ALIGN (4);
_DebugExceptionVector_literal_end = ABSOLUTE(.);
} >iram0_4_seg :iram0_4_phdr
.DebugExceptionVector.text : ALIGN(4)
{
_DebugExceptionVector_text_start = ABSOLUTE(.);
KEEP (*(.DebugExceptionVector.text))
. = ALIGN (4);
_DebugExceptionVector_text_end = ABSOLUTE(.);
} >iram0_5_seg :iram0_5_phdr
.NMIExceptionVector.literal : ALIGN(4)
{
_NMIExceptionVector_literal_start = ABSOLUTE(.);
*(.NMIExceptionVector.literal)
. = ALIGN (4);
_NMIExceptionVector_literal_end = ABSOLUTE(.);
} >iram0_5_seg :iram0_5_phdr
.NMIExceptionVector.text : ALIGN(4)
{
_NMIExceptionVector_text_start = ABSOLUTE(.);
KEEP (*(.NMIExceptionVector.text))
. = ALIGN (4);
_NMIExceptionVector_text_end = ABSOLUTE(.);
} >iram0_6_seg :iram0_6_phdr
.KernelExceptionVector.literal : ALIGN(4)
{
_KernelExceptionVector_literal_start = ABSOLUTE(.);
*(.KernelExceptionVector.literal)
. = ALIGN (4);
_KernelExceptionVector_literal_end = ABSOLUTE(.);
} >iram0_6_seg :iram0_6_phdr
.KernelExceptionVector.text : ALIGN(4)
{
_KernelExceptionVector_text_start = ABSOLUTE(.);
KEEP (*(.KernelExceptionVector.text))
. = ALIGN (4);
_KernelExceptionVector_text_end = ABSOLUTE(.);
} >iram0_7_seg :iram0_7_phdr
.UserExceptionVector.literal : ALIGN(4)
{
_UserExceptionVector_literal_start = ABSOLUTE(.);
*(.UserExceptionVector.literal)
. = ALIGN (4);
_UserExceptionVector_literal_end = ABSOLUTE(.);
} >iram0_7_seg :iram0_7_phdr
.UserExceptionVector.text : ALIGN(4)
{
_UserExceptionVector_text_start = ABSOLUTE(.);
KEEP (*(.UserExceptionVector.text))
. = ALIGN (4);
_UserExceptionVector_text_end = ABSOLUTE(.);
} >iram0_8_seg :iram0_8_phdr
.DoubleExceptionVector.literal : ALIGN(4)
{
_DoubleExceptionVector_literal_start = ABSOLUTE(.);
*(.DoubleExceptionVector.literal)
. = ALIGN (4);
_DoubleExceptionVector_literal_end = ABSOLUTE(.);
} >iram0_8_seg :iram0_8_phdr
.DoubleExceptionVector.text : ALIGN(4)
{
_DoubleExceptionVector_text_start = ABSOLUTE(.);
KEEP (*(.DoubleExceptionVector.text))
. = ALIGN (4);
_DoubleExceptionVector_text_end = ABSOLUTE(.);
} >iram0_9_seg :iram0_9_phdr
_memmap_seg_iram0_0_max = ALIGN(0x8);
.text : ALIGN(4)
{
_stext = .;
_text_start = ABSOLUTE(.);
*(.entry.text)
*(.init.literal)
KEEP(*(.init))
*(.literal.sort.* SORT(.text.sort.*))
KEEP (*(.literal.keepsort.* SORT(.text.keepsort.*) .literal.keep.* .text.keep.* .literal.*personality* .text.*personality*))
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
*(.fini.literal)
KEEP(*(.fini))
*(.gnu.version)
. = ALIGN (4);
_text_end = ABSOLUTE(.);
_etext = .;
} >ddr1_0_seg :ddr1_0_phdr
.rtos.rodata : ALIGN(4)
{
_rtos_rodata_start = ABSOLUTE(.);
*(.rtos.rodata)
. = ALIGN (4);
_rtos_rodata_end = ABSOLUTE(.);
} >ddr1_0_seg :ddr1_0_phdr
.clib.rodata : ALIGN(4)
{
_clib_rodata_start = ABSOLUTE(.);
*(.clib.rodata)
. = ALIGN (4);
_clib_rodata_end = ABSOLUTE(.);
} >ddr1_0_seg :ddr1_0_phdr
.rodata : ALIGN(4)
{
_rodata_start = ABSOLUTE(.);
*(.rodata)
*(SORT(.rodata.sort.*))
KEEP (*(SORT(.rodata.keepsort.*) .rodata.keep.*))
*(.rodata.*)
*(.gnu.linkonce.r.*)
*(.rodata1)
__XT_EXCEPTION_TABLE__ = ABSOLUTE(.);
KEEP (*(.xt_except_table))
KEEP (*(.gcc_except_table))
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
KEEP (*(.eh_frame))
/* C++ constructor and destructor tables, properly ordered: */
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
/* C++ exception handlers table: */
__XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
*(.xt_except_desc)
*(.gnu.linkonce.h.*)
__XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
*(.xt_except_desc_end)
*(.dynamic)
*(.gnu.version_d)
. = ALIGN(4); /* this table MUST be 4-byte aligned */
_bss_table_start = ABSOLUTE(.);
LONG(_bss_start)
LONG(_bss_end)
_bss_table_end = ABSOLUTE(.);
. = ALIGN (4);
_rodata_end = ABSOLUTE(.);
} >ddr1_0_seg :ddr1_0_phdr
.data : ALIGN(4)
{
_data_start = ABSOLUTE(.);
*(.data)
*(SORT(.data.sort.*))
KEEP (*(SORT(.data.keepsort.*) .data.keep.*))
*(.data.*)
*(.gnu.linkonce.d.*)
KEEP(*(.gnu.linkonce.d.*personality*))
*(.data1)
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
KEEP(*(.jcr))
*(__llvm_prf_cnts)
*(__llvm_prf_data)
*(__llvm_prf_vnds)
. = ALIGN (4);
_data_end = ABSOLUTE(.);
} >ddr1_0_seg :ddr1_0_phdr
.clib.data : ALIGN(4)
{
_clib_data_start = ABSOLUTE(.);
*(.clib.data)
. = ALIGN (4);
_clib_data_end = ABSOLUTE(.);
} >ddr1_0_seg :ddr1_0_phdr
.bss (NOLOAD) : ALIGN(8)
{
. = ALIGN (8);
_bss_start = ABSOLUTE(.);
*(.dynsbss)
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
*(.sbss2)
*(.sbss2.*)
*(.gnu.linkonce.sb2.*)
*(.dynbss)
*(.bss)
*(SORT(.bss.sort.*))
KEEP (*(SORT(.bss.keepsort.*) .bss.keep.*))
*(.bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
*(.clib.bss)
*(.clib.percpu.bss)
*(.rtos.percpu.bss)
*(.rtos.bss)
*(.dram0.bss)
. = ALIGN (8);
_bss_end = ABSOLUTE(.);
_end = ALIGN(0x8);
PROVIDE(end = ALIGN(0x8));
_stack_sentry = ALIGN(0x8);
_memmap_seg_dram0_0_end = ALIGN(0x8);
} >ddr1_0_seg :ddr1_0_phdr
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.xt.insn 0 :
{
KEEP (*(.xt.insn))
KEEP (*(.gnu.linkonce.x.*))
}
.xt.prop 0 :
{
KEEP (*(.xt.prop))
KEEP (*(.xt.prop.*))
KEEP (*(.gnu.linkonce.prop.*))
}
.xt.lit 0 :
{
KEEP (*(.xt.lit))
KEEP (*(.xt.lit.*))
KEEP (*(.gnu.linkonce.p.*))
}
.debug.xt.callgraph 0 :
{
KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*))
}
PROVIDE(__stack = 0x37d00000);
_heap_sentry = 0x37d00000;
}