rom.lk
1.96 KB
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
SECTIONS
{
. = 0xbfc00000;
.cpram :
{
entry.o(.text)
} >rom_copy
.handler1 :
{
handler1.o(.text)
} >rom_exception1
.handler2 :
{
handler2.o(.text)
} >rom_exception2
.handler3 :
{
handler3.o(.text)
} >rom_exception3
. = 0xbfc40000; /* start of isram, kseg1 */
/* textu holds uncached text. Code running uncached must */
/* not have data or bss sections (should all be asm). */
/* The LMA is at 0x400 into rom to leave space for the */
/* MIPS exception handlers. */
.textu : AT(0xbfc00400)
{
__s_text = .; /* define symbol at text start */
bootu.o(.text)
}
__s_la_text = LOADADDR(.textu);
. = . - 0x20000000; /* code from here linked to kseg0 */
.text : AT(0xbfc00400 + SIZEOF(.textu))
{
*(.text)
}
.rodata : AT(0xbfc00400 + SIZEOF(.textu) + SIZEOF(.text))
{
*(.rodata)
__e_text = . + 0x20000000; /* define symbol at end of text */
}
/* we actually shouldn't have anything below here in boot code */
/* watch out - if no .rodata from objects and no declarations, */
/* we'll get a forward reference error on .rodata in next line. */
.data : AT(0xbfc00400 + SIZEOF(.textu) + SIZEOF(.text)
+ SIZEOF(.rodata))
{
*(.data)
}
_gp = .;
.sbss :
{
__s_sbss = .; /* define symbol at bss start */
*(.sbss) *(.scommon)
__e_sbss = .; /* define symbol at bss end */
}
.bss :
{
__s_bss = .; /* define symbol at bss start */
*(.bss)
__e_bss = .; /* define symbol at bss end */
}
/* bogus area for reginfo to hide */
. = 0x4000;
.reginfo : { *(.reginfo) }
}
/* rom length is 8K (0x2000) */
MEMORY
{
/* rom_copy code executes out of rom */
rom_copy : ORIGIN = 0xbfc00000, LENGTH = 0x200
/* space for MIPS exception handlers */
rom_exception1 : ORIGIN = 0xbfc00200, LENGTH = 0x80
rom_exception2 : ORIGIN = 0xbfc00280, LENGTH = 0x100
rom_exception3 : ORIGIN = 0xbfc00380, LENGTH = 0x80
}