-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmars-ssf.ld
More file actions
140 lines (126 loc) · 2.84 KB
/
mars-ssf.ld
File metadata and controls
140 lines (126 loc) · 2.84 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
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
OUTPUT_ARCH(sh)
EXTERN (_start)
ENTRY (_start)
__DYNAMIC = 0;
/*
* The memory map look like this:
* +--------------------+ <- 0x02000000
* | .text |
* | |
* | __text_end |
* +--------------------+
* . .
* . .
* . .
* +--------------------+ <- 0x06000000
* | .data | initialized data goes here
* | |
* | __data_end |
* +--------------------+
* | .bss |
* | __bss_start | start of bss, cleared by crt0
* | |
* | __bss__end | start of heap, used by sbrk()
* +--------------------+
* . .
* . .
* . .
* | __stack | top of stack (for Primary SH2)
* +--------------------+ <- 0x0603F400
* | __stack | top of stack (for Secondary SH2)
* +--------------------+ <- 0x06040000
*/
MEMORY
{
rom (rx) : ORIGIN = 0x02000000, LENGTH = 0x00500000
ram (wx) : ORIGIN = 0x06000000, LENGTH = 0x0003F800
}
/*
* Allocate the stack to be at the top of memory, since the stack
* grows down
*/
PROVIDE (__stack = 0x0603F800);
SECTIONS
{
.text 0x02000000 :
AT ( 0x00000000 )
{
__text_start = .;
*(.text)
*(.text.*)
*(.gnu.linkonce.t.*)
. = ALIGN(16);
__INIT_SECTION__ = .;
KEEP (*(.init))
SHORT (0x000B) /* rts */
SHORT (0x0009) /* nop */
. = ALIGN(16);
__FINI_SECTION__ = .;
KEEP (*(.fini))
SHORT (0x000B) /* rts */
SHORT (0x0009) /* nop */
*(.eh_frame_hdr)
KEEP (*(.eh_frame))
*(.gcc_except_table)
*(.gcc_except_table.*)
KEEP (*(.jcr))
. = ALIGN(16);
__CTOR_LIST__ = .;
___CTOR_LIST__ = .;
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
LONG(0)
__CTOR_END__ = .;
. = ALIGN(16);
__DTOR_LIST__ = .;
___DTOR_LIST__ = .;
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
LONG(0)
__DTOR_END__ = .;
*(.rdata)
*(.rodata)
*(.rodata.*)
*(.gnu.linkonce.r.*)
. = ALIGN(16);
__text_end = .;
} > rom
__text_size = __text_end - __text_start;
.data 0x06000000 :
AT ( LOADADDR (.text) + SIZEOF (.text) )
{
__data_start = .;
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
*(.lit8)
*(.lit4)
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
. = ALIGN(16);
__data_end = .;
} > ram
__data_size = __data_end - __data_start;
.bss :
{
__bss_start = .;
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b.*)
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
*(COMMON)
. = ALIGN(16);
end = .;
_end = end;
__end = _end;
__bss_end = .;
} > ram
__bss_size = __bss_end - __bss_start;
}