-
Notifications
You must be signed in to change notification settings - Fork 8
/
boot-linkerscript.ld
623 lines (610 loc) · 24.2 KB
/
boot-linkerscript.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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-tradlittlemips")
OUTPUT_ARCH(pic32mx)
ENTRY(_reset)
/*
* Provide for a minimum stack and heap size
* - _min_stack_size - represents the minimum space that must be made
* available for the stack. Can be overridden from
* the command line using the linker's --defsym option.
* - _min_heap_size - represents the minimum space that must be made
* available for the heap. Can be overridden from
* the command line using the linker's --defsym option.
*/
EXTERN (_min_stack_size _min_heap_size)
PROVIDE(_min_stack_size = 0x400) ;
PROVIDE(_min_heap_size = 0) ;
/*************************************************************************
* Processor-specific object file. Contains SFR definitions.
*************************************************************************/
INPUT("processor.o")
/*************************************************************************
* For interrupt vector handling
*************************************************************************/
PROVIDE(_vector_spacing = 0x00000001);
//_ebase_address = 0x9FC01000;
_ebase_address = 0x0;
//_general_exception_context = 0xBFC00000;
//_on_bootstrap = 0xBFC00000;
/*************************************************************************
* Memory Address Equates
*************************************************************************/
_RESET_ADDR = 0xBFC00000;
_BEV_EXCPT_ADDR = 0xBFC00380;
_DBG_EXCPT_ADDR = 0xBFC00480;
_GEN_EXCPT_ADDR = _ebase_address + 0x180;
/*************************************************************************
* Memory Regions
*
* Memory regions without attributes cannot be used for orphaned sections.
* Only sections specifically assigned to these regions can be allocated
* into these regions.
*************************************************************************/
MEMORY
{
kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x00000
//kseg0_boot_mem (rx) : ORIGIN = 0x9FC00490, LENGTH = 0x970
//exception_mem : ORIGIN = 0x9FC01180, LENGTH = 0x90
//kseg0_boot_memB (rx) : ORIGIN = 0x9FC01210, LENGTH = 0xDF0
kseg0_boot_mem (rx) : ORIGIN = 0x9FC00490, LENGTH = 0x2B00
exception_mem : ORIGIN = 0x9FC00000, LENGTH = 0x0
kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0x490
config3 : ORIGIN = 0xBFC02FF0, LENGTH = 0x4
config2 : ORIGIN = 0xBFC02FF4, LENGTH = 0x4
config1 : ORIGIN = 0xBFC02FF8, LENGTH = 0x4
config0 : ORIGIN = 0xBFC02FFC, LENGTH = 0x4
boot_software_key : ORIGIN = 0xA0000000, LENGTH = 0x4
kseg1_data_mem (w!x) : ORIGIN = 0xA0000004, LENGTH = 0x7FFC
/*
kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x8000
*/
sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000
}
SECTIONS
{
.boot_software_key_sec : {
*(.boot_software_key_sec)
} > boot_software_key
.config_BFC02FF0 : {
KEEP(*(.config_BFC02FF0))
} > config3
.config_BFC02FF4 : {
KEEP(*(.config_BFC02FF4))
} > config2
.config_BFC02FF8 : {
KEEP(*(.config_BFC02FF8))
} > config1
.config_BFC02FFC : {
KEEP(*(.config_BFC02FFC))
} > config0
}
SECTIONS
{
/* Boot Sections */
.reset _RESET_ADDR :
{
KEEP(*(.reset))
} > kseg1_boot_mem
.dbg_excpt _DBG_EXCPT_ADDR (NOLOAD) :
{
. += (DEFINED (_DEBUGGER) ? 0x8 : 0x0);
} > kseg1_boot_mem
/DISCARD/ :
{
*(.gen_handler)
}
/DISCARD/ :
{
*(.vector_0)
}
/*
.vector_1 _ebase_address + 0x200 + (_vector_spacing << 5) * 1 :
{
KEEP(*(.vector_1))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_1) <= (_vector_spacing << 5), "function at exception vector 1 too large")
.vector_2 _ebase_address + 0x200 + (_vector_spacing << 5) * 2 :
{
KEEP(*(.vector_2))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_2) <= (_vector_spacing << 5), "function at exception vector 2 too large")
.vector_3 _ebase_address + 0x200 + (_vector_spacing << 5) * 3 :
{
KEEP(*(.vector_3))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_3) <= (_vector_spacing << 5), "function at exception vector 3 too large")
.vector_4 _ebase_address + 0x200 + (_vector_spacing << 5) * 4 :
{
KEEP(*(.vector_4))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_4) <= (_vector_spacing << 5), "function at exception vector 4 too large")
.vector_5 _ebase_address + 0x200 + (_vector_spacing << 5) * 5 :
{
KEEP(*(.vector_5))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_5) <= (_vector_spacing << 5), "function at exception vector 5 too large")
.vector_6 _ebase_address + 0x200 + (_vector_spacing << 5) * 6 :
{
KEEP(*(.vector_6))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_6) <= (_vector_spacing << 5), "function at exception vector 6 too large")
.vector_7 _ebase_address + 0x200 + (_vector_spacing << 5) * 7 :
{
KEEP(*(.vector_7))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_7) <= (_vector_spacing << 5), "function at exception vector 7 too large")
.vector_8 _ebase_address + 0x200 + (_vector_spacing << 5) * 8 :
{
KEEP(*(.vector_8))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_8) <= (_vector_spacing << 5), "function at exception vector 8 too large")
.vector_9 _ebase_address + 0x200 + (_vector_spacing << 5) * 9 :
{
KEEP(*(.vector_9))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_9) <= (_vector_spacing << 5), "function at exception vector 9 too large")
.vector_10 _ebase_address + 0x200 + (_vector_spacing << 5) * 10 :
{
KEEP(*(.vector_10))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_10) <= (_vector_spacing << 5), "function at exception vector 10 too large")
.vector_11 _ebase_address + 0x200 + (_vector_spacing << 5) * 11 :
{
KEEP(*(.vector_11))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_11) <= (_vector_spacing << 5), "function at exception vector 11 too large")
.vector_12 _ebase_address + 0x200 + (_vector_spacing << 5) * 12 :
{
KEEP(*(.vector_12))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_12) <= (_vector_spacing << 5), "function at exception vector 12 too large")
.vector_13 _ebase_address + 0x200 + (_vector_spacing << 5) * 13 :
{
KEEP(*(.vector_13))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_13) <= (_vector_spacing << 5), "function at exception vector 13 too large")
.vector_14 _ebase_address + 0x200 + (_vector_spacing << 5) * 14 :
{
KEEP(*(.vector_14))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_14) <= (_vector_spacing << 5), "function at exception vector 14 too large")
.vector_15 _ebase_address + 0x200 + (_vector_spacing << 5) * 15 :
{
KEEP(*(.vector_15))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_15) <= (_vector_spacing << 5), "function at exception vector 15 too large")
.vector_16 _ebase_address + 0x200 + (_vector_spacing << 5) * 16 :
{
KEEP(*(.vector_16))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_16) <= (_vector_spacing << 5), "function at exception vector 16 too large")
.vector_17 _ebase_address + 0x200 + (_vector_spacing << 5) * 17 :
{
KEEP(*(.vector_17))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_17) <= (_vector_spacing << 5), "function at exception vector 17 too large")
.vector_18 _ebase_address + 0x200 + (_vector_spacing << 5) * 18 :
{
KEEP(*(.vector_18))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_18) <= (_vector_spacing << 5), "function at exception vector 18 too large")
.vector_19 _ebase_address + 0x200 + (_vector_spacing << 5) * 19 :
{
KEEP(*(.vector_19))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_19) <= (_vector_spacing << 5), "function at exception vector 19 too large")
.vector_20 _ebase_address + 0x200 + (_vector_spacing << 5) * 20 :
{
KEEP(*(.vector_20))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_20) <= (_vector_spacing << 5), "function at exception vector 20 too large")
.vector_21 _ebase_address + 0x200 + (_vector_spacing << 5) * 21 :
{
KEEP(*(.vector_21))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_21) <= (_vector_spacing << 5), "function at exception vector 21 too large")
.vector_22 _ebase_address + 0x200 + (_vector_spacing << 5) * 22 :
{
KEEP(*(.vector_22))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_22) <= (_vector_spacing << 5), "function at exception vector 22 too large")
.vector_23 _ebase_address + 0x200 + (_vector_spacing << 5) * 23 :
{
KEEP(*(.vector_23))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_23) <= (_vector_spacing << 5), "function at exception vector 23 too large")
.vector_24 _ebase_address + 0x200 + (_vector_spacing << 5) * 24 :
{
KEEP(*(.vector_24))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_24) <= (_vector_spacing << 5), "function at exception vector 24 too large")
.vector_25 _ebase_address + 0x200 + (_vector_spacing << 5) * 25 :
{
KEEP(*(.vector_25))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_25) <= (_vector_spacing << 5), "function at exception vector 25 too large")
.vector_26 _ebase_address + 0x200 + (_vector_spacing << 5) * 26 :
{
KEEP(*(.vector_26))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_26) <= (_vector_spacing << 5), "function at exception vector 26 too large")
.vector_27 _ebase_address + 0x200 + (_vector_spacing << 5) * 27 :
{
KEEP(*(.vector_27))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_27) <= (_vector_spacing << 5), "function at exception vector 27 too large")
.vector_28 _ebase_address + 0x200 + (_vector_spacing << 5) * 28 :
{
KEEP(*(.vector_28))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_28) <= (_vector_spacing << 5), "function at exception vector 28 too large")
.vector_29 _ebase_address + 0x200 + (_vector_spacing << 5) * 29 :
{
KEEP(*(.vector_29))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_29) <= (_vector_spacing << 5), "function at exception vector 29 too large")
.vector_30 _ebase_address + 0x200 + (_vector_spacing << 5) * 30 :
{
KEEP(*(.vector_30))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_30) <= (_vector_spacing << 5), "function at exception vector 30 too large")
.vector_31 _ebase_address + 0x200 + (_vector_spacing << 5) * 31 :
{
KEEP(*(.vector_31))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_31) <= (_vector_spacing << 5), "function at exception vector 31 too large")
.vector_32 _ebase_address + 0x200 + (_vector_spacing << 5) * 32 :
{
KEEP(*(.vector_32))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_32) <= (_vector_spacing << 5), "function at exception vector 32 too large")
.vector_33 _ebase_address + 0x200 + (_vector_spacing << 5) * 33 :
{
KEEP(*(.vector_33))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_33) <= (_vector_spacing << 5), "function at exception vector 33 too large")
.vector_34 _ebase_address + 0x200 + (_vector_spacing << 5) * 34 :
{
KEEP(*(.vector_34))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_34) <= (_vector_spacing << 5), "function at exception vector 34 too large")
.vector_35 _ebase_address + 0x200 + (_vector_spacing << 5) * 35 :
{
KEEP(*(.vector_35))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_35) <= (_vector_spacing << 5), "function at exception vector 35 too large")
.vector_36 _ebase_address + 0x200 + (_vector_spacing << 5) * 36 :
{
KEEP(*(.vector_36))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_36) <= (_vector_spacing << 5), "function at exception vector 36 too large")
.vector_37 _ebase_address + 0x200 + (_vector_spacing << 5) * 37 :
{
KEEP(*(.vector_37))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_37) <= (_vector_spacing << 5), "function at exception vector 37 too large")
.vector_38 _ebase_address + 0x200 + (_vector_spacing << 5) * 38 :
{
KEEP(*(.vector_38))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_38) <= (_vector_spacing << 5), "function at exception vector 38 too large")
.vector_39 _ebase_address + 0x200 + (_vector_spacing << 5) * 39 :
{
KEEP(*(.vector_39))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_39) <= (_vector_spacing << 5), "function at exception vector 39 too large")
.vector_40 _ebase_address + 0x200 + (_vector_spacing << 5) * 40 :
{
KEEP(*(.vector_40))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_40) <= (_vector_spacing << 5), "function at exception vector 40 too large")
.vector_41 _ebase_address + 0x200 + (_vector_spacing << 5) * 41 :
{
KEEP(*(.vector_41))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_41) <= (_vector_spacing << 5), "function at exception vector 41 too large")
.vector_42 _ebase_address + 0x200 + (_vector_spacing << 5) * 42 :
{
KEEP(*(.vector_42))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_42) <= (_vector_spacing << 5), "function at exception vector 42 too large")
.vector_43 _ebase_address + 0x200 + (_vector_spacing << 5) * 43 :
{
KEEP(*(.vector_43))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_43) <= (_vector_spacing << 5), "function at exception vector 43 too large")
.vector_44 _ebase_address + 0x200 + (_vector_spacing << 5) * 44 :
{
KEEP(*(.vector_44))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_44) <= (_vector_spacing << 5), "function at exception vector 44 too large")
.vector_45 _ebase_address + 0x200 + (_vector_spacing << 5) * 45 :
{
KEEP(*(.vector_45))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_45) <= (_vector_spacing << 5), "function at exception vector 45 too large")
.vector_46 _ebase_address + 0x200 + (_vector_spacing << 5) * 46 :
{
KEEP(*(.vector_46))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_46) <= (_vector_spacing << 5), "function at exception vector 46 too large")
.vector_47 _ebase_address + 0x200 + (_vector_spacing << 5) * 47 :
{
KEEP(*(.vector_47))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_47) <= (_vector_spacing << 5), "function at exception vector 47 too large")
.vector_48 _ebase_address + 0x200 + (_vector_spacing << 5) * 48 :
{
KEEP(*(.vector_48))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_48) <= (_vector_spacing << 5), "function at exception vector 48 too large")
.vector_49 _ebase_address + 0x200 + (_vector_spacing << 5) * 49 :
{
KEEP(*(.vector_49))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_49) <= (_vector_spacing << 5), "function at exception vector 49 too large")
.vector_50 _ebase_address + 0x200 + (_vector_spacing << 5) * 50 :
{
KEEP(*(.vector_50))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_50) <= (_vector_spacing << 5), "function at exception vector 50 too large")
.vector_51 _ebase_address + 0x200 + (_vector_spacing << 5) * 51 :
{
KEEP(*(.vector_51))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_51) <= (_vector_spacing << 5), "function at exception vector 51 too large")
.vector_52 _ebase_address + 0x200 + (_vector_spacing << 5) * 52 :
{
KEEP(*(.vector_52))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_52) <= (_vector_spacing << 5), "function at exception vector 52 too large")
.vector_53 _ebase_address + 0x200 + (_vector_spacing << 5) * 53 :
{
KEEP(*(.vector_53))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_53) <= (_vector_spacing << 5), "function at exception vector 53 too large")
.vector_54 _ebase_address + 0x200 + (_vector_spacing << 5) * 54 :
{
KEEP(*(.vector_54))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_54) <= (_vector_spacing << 5), "function at exception vector 54 too large")
.vector_55 _ebase_address + 0x200 + (_vector_spacing << 5) * 55 :
{
KEEP(*(.vector_55))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_55) <= (_vector_spacing << 5), "function at exception vector 55 too large")
.vector_56 _ebase_address + 0x200 + (_vector_spacing << 5) * 56 :
{
KEEP(*(.vector_56))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_56) <= (_vector_spacing << 5), "function at exception vector 56 too large")
.vector_57 _ebase_address + 0x200 + (_vector_spacing << 5) * 57 :
{
KEEP(*(.vector_57))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_57) <= (_vector_spacing << 5), "function at exception vector 57 too large")
.vector_58 _ebase_address + 0x200 + (_vector_spacing << 5) * 58 :
{
KEEP(*(.vector_58))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_58) <= (_vector_spacing << 5), "function at exception vector 58 too large")
.vector_59 _ebase_address + 0x200 + (_vector_spacing << 5) * 59 :
{
KEEP(*(.vector_59))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_59) <= (_vector_spacing << 5), "function at exception vector 59 too large")
.vector_60 _ebase_address + 0x200 + (_vector_spacing << 5) * 60 :
{
KEEP(*(.vector_60))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_60) <= (_vector_spacing << 5), "function at exception vector 60 too large")
.vector_61 _ebase_address + 0x200 + (_vector_spacing << 5) * 61 :
{
KEEP(*(.vector_61))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_61) <= (_vector_spacing << 5), "function at exception vector 61 too large")
.vector_62 _ebase_address + 0x200 + (_vector_spacing << 5) * 62 :
{
KEEP(*(.vector_62))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_62) <= (_vector_spacing << 5), "function at exception vector 62 too large")
.vector_63 _ebase_address + 0x200 + (_vector_spacing << 5) * 63 :
{
KEEP(*(.vector_63))
} > exception_mem
ASSERT (_vector_spacing == 0 || SIZEOF(.vector_63) <= (_vector_spacing << 5), "function at exception vector 63 too large")
*/
.startup ORIGIN(kseg0_boot_mem) :
{
KEEP(*(.startup))
} > kseg0_boot_mem
/* Code Sections */
.text :
{
_text_begin = . ;
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.mips16.fn.*)
*(.mips16.call.*)
_text_end = . ;
} >kseg0_boot_mem
/* Read-only sections */
.rodata :
{
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.rodata1)
. = ALIGN(4) ;
} >kseg0_boot_mem
/*
* Small initialized constant global and static data can be placed in the
* .sdata2 section. This is different from .sdata, which contains small
* initialized non-constant global and static data.
*/
.sdata2 ALIGN(4) :
{
*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
. = ALIGN(4) ;
} >kseg0_boot_mem
/*
* Uninitialized constant global and static data (i.e., variables which will
* always be zero). Again, this is different from .sbss, which contains
* small non-initialized, non-constant global and static data.
*/
.sbss2 ALIGN(4) :
{
*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
. = ALIGN(4) ;
} >kseg0_boot_mem
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.dbg_data (NOLOAD) :
{
. += (DEFINED (_DEBUGGER) ? 0x200 : 0x0);
} >kseg1_data_mem
.data :
{
_data_begin = . ;
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
*(.data1)
} >kseg1_data_mem AT>kseg0_boot_mem
_data_image_begin = LOADADDR(.data) ;
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
. = .;
_gp = ALIGN(16) + 0x7ff0;
.got ALIGN(4) :
{
*(.got.plt) *(.got)
} >kseg1_data_mem AT>kseg0_boot_mem
/*
* We want the small data sections together, so single-instruction offsets
* can access them all, and initialized data all before uninitialized, so
* we can shorten the on-disk segment size.
*/
.sdata ALIGN(4) :
{
_sdata_begin = . ;
*(.sdata .sdata.* .gnu.linkonce.s.*)
_sdata_end = . ;
} >kseg1_data_mem AT>kseg0_boot_mem
.lit8 :
{
*(.lit8)
} >kseg1_data_mem AT>kseg0_boot_mem
.lit4 :
{
*(.lit4)
} >kseg1_data_mem AT>kseg0_boot_mem
. = ALIGN (4) ;
_data_end = . ;
_bss_begin = . ;
.sbss ALIGN(4) :
{
_sbss_begin = . ;
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
_sbss_end = . ;
} >kseg1_data_mem
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/*
* Align here to ensure that the .bss section occupies space up to
* _end. Align after .bss to ensure correct alignment even if the
* .bss section disappears because there are no input sections.
*/
. = ALIGN(4) ;
} >kseg1_data_mem
. = ALIGN(4) ;
_end = . ;
_bss_end = . ;
/* Heap allocating takes a chunk of memory following BSS */
.heap ALIGN(8) :
{
_heap = . ;
. += _min_heap_size ;
. = ALIGN(8);
} >kseg1_data_mem
/* Stack allocation follows the heap */
.stack ALIGN(8) :
{
_splim = . ;
_SPLIM = . ;
. += _min_stack_size ;
. = ALIGN(8);
} >kseg1_data_mem
/*
* RAM functions go at the end of our stack and heap allocation.
* Alignment of 2K required by the boundary register (BMXDKPBA).
*/
.ramfunc ALIGN(2K) :
{
_ramfunc_begin = . ;
*(.ramfunc .ramfunc.*)
. = ALIGN(4) ;
_ramfunc_end = . ;
} >kseg1_data_mem AT>kseg0_boot_mem
_ramfunc_image_begin = LOADADDR(.ramfunc) ;
_ramfunc_length = SIZEOF(.ramfunc) ;
_bmxdkpba_address = _ramfunc_begin - ORIGIN(kseg1_data_mem) ;
_bmxdudba_address = LENGTH(kseg1_data_mem) ;
_bmxdupba_address = LENGTH(kseg1_data_mem) ;
/*
* The actual top of stack should include the gap between the stack
* section and the beginning of the .ramfunc section caused by the
* alignment of the .ramfunc section minus 2 words. If RAM functions
* do not exist, then the top of the stack should point to the end of
* the data memory.
*/
_stack = (_ramfunc_length > 0)
? _ramfunc_begin - 8
: ORIGIN(kseg1_data_mem) + LENGTH(kseg1_data_mem) ;
ASSERT((_min_stack_size + _min_heap_size) <= (_stack - _heap),
"Not enough space to allocate both stack and heap. Reduce heap and/or stack size.")
/* The .pdr section belongs in the absolute section */
/DISCARD/ : { *(.pdr) }
/* We don't load .reginfo onto the target, so don't locate it
* in real memory
*/
/DISCARD/ : { *(.reginfo) }
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/DISCARD/ : { *(.rel.dyn) }
/DISCARD/ : { *(.note.GNU-stack) }
}