-
Notifications
You must be signed in to change notification settings - Fork 1
/
ldscript_dol.txt
222 lines (221 loc) · 4.24 KB
/
ldscript_dol.txt
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
OUTPUT_ARCH(powerpc)
ENTRY(dol_entrypoint)
init_size = init_end - init_start;
extab_size = extab_end - extab_start;
extab_index_size = extab_index_end - extab_index_start;
text_size = text_end - text_start;
ctors_size = ctors_end - ctors_start;
dtors_size = dtors_end - dtors_start;
rodata_size = rodata_end - rodata_start;
data_size = data_end - data_start;
bss_size = bss_end - bss_start;
sdata_size = sdata_end - sdata_start;
sbss_size = sbss_end - sbss_start;
sdata2_size = sdata2_end - sdata2_start;
sbss2_size = sbss2_end - sbss2_start;
init_offset = ADDR(.header) + SIZEOF(.header);
text_offset = init_offset + init_size;
extab_offset = text_offset + text_size;
extab_index_offset = extab_offset + extab_size;
ctors_offset = extab_index_offset + extab_index_size;
dtors_offset = ctors_offset + ctors_size;
rodata_offset = dtors_offset + dtors_size;
data_offset = rodata_offset + rodata_size;
sdata_offset = data_offset + data_size;
sdata2_offset = sdata_offset + sdata_size;
bssTotalSize = sbss2_end - bss_start; /* main.dol header */
codehandler_size = codehandler_end - codehandler_start;
gct_size = gct_end - gct_start;
codehandler_offset = sdata2_offset + sdata2_size;
gct_offset = codehandler_offset + codehandler_size;
SECTIONS {
.header :
ALIGN(4) {
dolheader.o(.data);
}
.globalsLow 0x80000000 (NOLOAD):
ALIGN(4) {
../global/DolphinGlobals.o(.bss);
} = 0
/* Gecko */
.codehandler 0x80001800 :
AT(codehandler_offset)
ALIGN(4) {
codehandler_start = .;
../global/gecko_codehandler.o(.text);
codehandler_end = .;
}
/* TODO: Conditionally move to end of apploader */
.gctdata :
AT(gct_offset)
ALIGN(4) {
gct_start = .;
../global/gct.o(.data);
gct_end = .;
}
.globalsHigh 0x80003000 (NOLOAD):
ALIGN(4) {
../global/DolphinGlobals2.o(.bss);
} = 0
.init 0x80004000 :
AT(init_offset)
ALIGN(4) {
init_start = .;
TRK_Exception.o(.text);
memset.o(.text);
CheckGCPad4.o(.text);
crt.o(.text);
init.o(.text);
init.o(.data);
init_end = .;
}
.extab :
AT(extab_offset)
ALIGN(4) {
extab_start = .;
extab.o(.data);
extab_end = .;
}
.extab_index :
AT(extab_index_offset)
ALIGN(4) {
extab_index_start = .;
extabindex.o(.data);
extab_index_end = .;
}
.text :
AT(text_offset)
ALIGN(4) {
text_start = .;
text.o(.text);
. += 8;
text_1a940.o(.text);
. += 12;
text_1ab10.o(.text);
. += 12;
text_1ab30.o(.text);
. += 12;
text_1ac20.o(.text);
. += 12;
text_1ad80.o(.text);
. += 4;
text_1ae60.o(.text);
. += 4;
text_1b310.o(.text);
. += 12;
text_1b750.o(.text);
. += 4;
text_1b7d0.o(.text);
. += 12;
text_1bb80.o(.text);
. += 8;
text_1bc60.o(.text);
. += 4;
text_1bdf0.o(.text);
. += 4;
text_1e9a0.o(.text);
. += 8;
text_1ea60.o(.text);
. += 4;
text_1eb10.o(.text);
. += 12;
text_1ec50.o(.text);
. += 12;
text_1ecf0.o(.text);
. += 4;
text_44980.o(.text);
. += 8;
text_44a60.o(.text);
. += 4;
text_44a90.o(.text);
. += 12;
text_44b30.o(.text);
. += 8;
text_44c10.o(.text);
. += 8;
text_44cf0.o(.text);
. += 4;
text_44d70.o(.text);
. += 8;
text_44de0.o(.text);
. += 12;
text_45180.o(.text);
. += 12;
text_b2a30.o(.text);
. += 4;
text_b2e30.o(.text);
. += 12;
text_b34c0.o(.text);
. += 8;
text_b34d0.o(.text);
. += 12;
text_end = .;
}
.ctors :
AT(ctors_offset)
ALIGN(4) {
ctors_start = .;
ctors.o(.data);
ctors_end = .;
}
.dtors :
AT(dtors_offset)
ALIGN(4) {
dtors_start = .;
dtors.o(.data);
dtors_end = .;
}
. += 0x20;
.rodata :
AT(rodata_offset)
ALIGN(4) {
rodata_start = .;
rodata.o(.data);
rodata_end = .;
}
.data :
AT(data_offset)
ALIGN(4) {
data_start = .;
data.o(.data);
data_end = .;
}
.bss (NOLOAD) :
ALIGN(4) {
bss_start = .;
bss.o(.bss);
bss_end = .;
} = 0
.sdata (bss_end + 0x10) :
AT(sdata_offset)
ALIGN(4) {
sdata_start = .;
sdata.o(.data);
sdata_end = .;
}
.sbss (NOLOAD) :
ALIGN(4) {
sbss_start = .;
sbss.o(.bss);
sbss_end = .;
} = 0
. += 0x14;
.sdata2 :
AT(sdata2_offset)
ALIGN(4) {
sdata2_start = .;
sdata2.o(.data);
sdata2_end = .;
}
.sbss2 (NOLOAD) :
ALIGN(4) {
sbss2_start = .;
sbss2.o(.bss);
sbss2_end = .;
} = 0
/* TODO: StaticR.rel relocation table */
/* Discard everything not specifically mentioned above. */
/DISCARD/ : {
*(*);
}
}