summaryrefslogtreecommitdiff
path: root/ld_script.txt
blob: 0e1ea5139fedc6f917241d8cb51c07c9d1f136a1 (plain)
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
ENTRY(Start)

gNumMusicPlayers = 8;
gMaxLines = 0;

SECTIONS {
    . = 0x2000000;

    ewram (NOLOAD) :
    ALIGN(4)
    {
        ewram_start = .;
        INCLUDE "sym_ewram.ld"
        src/agb_flash.o(.bss);
        *libgcc.a:fp-bit.o(.bss);
        *libgcc.a:dp-bit.o(.bss);
        *libc.a:syscalls.o(.bss);
        . = ALIGN(16);
        INCLUDE "sym_ewram2.ld"
        *libc.a:impure.o(.data);
        *libc.a:locale.o(.data);
        *libc.a:mallocr.o(.data);
        gUnknown_203BC04 = .;
        . = 0x40000;
    }

    . = 0x3000000;

    iwram (NOLOAD) :
    ALIGN(4)
    {
        iwram_start = .;
        INCLUDE "sym_iwram.ld"
        . = 0x8000;
    }

    . = 0x8000000;

    .text :
    ALIGN(4)
    {
        asm/crt0.o(.text);
        asm/code.o(.text);
        src/code_80001E0.o(.text);
        asm/arm_func.o(.text);
        asm/code_2.o(.text);
        src/code.o(.text);
        asm/event_flag.o(.text);
        src/event_flag.o(.text);
        asm/code_8002774.o(.text);
        src/memory.o(.text);
        asm/memory.o(.text);
        src/memory1.o(.text);
        asm/code_80035F0.o(.text);
        src/other_random.o(.text);
        src/util.o(.text);
        src/bg_palette_buffer.o(.text);
        src/input.o(.text);
        asm/input.o(.text);
        asm/code_8004AA0.o(.text);
        src/sprite.o(.text);
        asm/sprite.o(.text);
        asm/code_800558C.o(.text);
        src/code_800558C.o(.text);
        src/random.o(.text);
        src/text.o(.text);
		. = ALIGN(4);
        asm/text.o(.text);
        asm/code_8009804.o(.text);
        src/file_system.o(.text);
        src/main.o(.text);
        asm/code_800B540.o(.text);
        src/code_800B5F0.o(.text);
        asm/code_800B5F0.o(.text);
        src/music_pre.o(.text);
        asm/music.o(.text);
        src/music.o(.text);
        src/code_800C9CC.o(.text);
        asm/code_800C9CC.o(.text);
        src/flash.o(.text);
        src/code_800D090.o(.text);
        asm/code_800D090.o(.text);
        src/code_80118A4.o(.text);
        asm/code_80118A4.o(.text);
        src/code_80118A4_1.o(.text);
        asm/fatal_system.o(.text);
        src/fatal_system.o(.text);
        asm/fatal_system_1.o(.text);
        src/save.o(.text);
        asm/save.o(.text);
        src/save_mid.o(.text);
        asm/save1.o(.text);
        src/save1.o(.text);
        asm/code_8012A18.o(.text);
        src/code_801D760.o(.text);
        asm/code_801D760.o(.text);
        src/code_8027C84_pre.o(.text);
        asm/code_8027C84.o(.text);
        src/code_8028DE8.o(.text);
        asm/code_8028DE8.o(.text);
        asm/personality_test.o(.text);
        src/personality_test.o(.text);
        asm/code_803D110.o(.text);
        src/code_8040094.o(.text);
        asm/code_8040094.o(.text);
        src/code_8041AD0.o(.text);
        asm/code_8041AD0.o(.text);
        src/code_80428A0.o(.text);
        asm/code_80428A0.o(.text);
        src/code_8048480.o(.text);
        asm/code_8048480.o(.text);
        src/code_80521D0.o(.text);
        asm/code_80521D0.o(.text);
        src/pokemon.o(.text);
        asm/pokemon.o(.text);
        src/pokemon_mid.o(.text);
        asm/pokemon_1.o(.text);
        src/pokemon_1.o(.text);
        src/code_808DAB4.o(.text);
        asm/code_808DAB4.o(.text);
        src/code_808EAB0.o(.text);
        asm/code_808EAB0.o(.text);
        src/dungeon.o(.text);
        asm/code_809017C.o(.text);
        src/code_8092334.o(.text);
        asm/code_8092334.o(.text);
        src/code_8094F88.o(.text);
        asm/code_8095014.o(.text);
        src/code_809747C.o(.text);
        asm/code_809747C.o(.text);
        src/code_8097F40.o(.text);
        asm/code_8097F40.o(.text);
        asm/code_8098468.o(.text);
        src/code_8098BDC.o(.text);
        asm/code_8098BDC.o(.text);
        src/code_809D148.o(.text);
        asm/code_809D148.o(.text);
        src/code_80A26CC.o(.text);
        asm/code_80A26CC.o(.text);
        src/code_80A7714.o(.text);
        asm/code_80A7714.o(.text);
        asm/m4a_1.o(.text);
        src/m4a.o(.text);
        *libagbsyscall.a:CpuSet.o(.text);
        *libagbsyscall.a:SoundBiasReset.o(.text);
        *libagbsyscall.a:SoundBiasSet.o(.text);
        *libagbsyscall.a:VBlankIntrWait.o(.text);
        src/agb_flash.o(.text);
        src/agb_flash_1m.o(.text);
        src/agb_flash_mx.o(.text);
        src/agb_flash_le.o(.text);
        *libgcc.a:_call_via_rX.o(.text);
        *libgcc.a:_divsi3.o(.text);
        *libgcc.a:_dvmd_tls.o(.text);
        *libgcc.a:_fixunssfsi.o(.text);
        *libgcc.a:_modsi3.o(.text);
        *libgcc.a:_umodsi3.o(.text);
        *libgcc.a:fp-bit.o(.text);
        *libgcc.a:_muldi3.o(.text);
        *libgcc.a:dp-bit.o(.text);
        *libgcc.a:_lshrdi3.o(.text);
        *libgcc.a:_negdi2.o(.text);
        *libc.a:memcpy.o(.text);
        *libc.a:memset.o(.text);
        *libc.a:sprintf.o(.text);
        *libc.a:strcat.o(.text);
        *libc.a:strcmp.o(.text);
        *libc.a:strcpy.o(.text);
        *libc.a:strlen.o(.text);
        *libc.a:strncpy.o(.text);
        *libc.a:vfprintf.o(.text);
        *libc.a:vsprintf.o(.text);
        *libc.a:wsetup.o(.text);
        *libc.a:dtoa.o(.text);
        *libc.a:fflush.o(.text);
        *libc.a:findfp.o(.text);
        *libc.a:freer.o(.text);
        *libc.a:fvwrite.o(.text);
        *libc.a:fwalk.o(.text);
        *libc.a:locale.o(.text);
        *libc.a:makebuf.o(.text);
        *libc.a:mallocr.o(.text);
        *libc.a:mbtowc_r.o(.text);
        *libc.a:memchr.o(.text);
        *libc.a:memmove.o(.text);
        *libc.a:mlock.o(.text);
        *libc.a:mprec.o(.text);
        *libc.a:s_isinf.o(.text);
        *libc.a:s_isnan.o(.text);
        *libc.a:sbrkr.o(.text);
        *libc.a:stdio.o(.text);
        *libc.a:syscalls.o(.text);
        *libc.a:writer.o(.text);
        *libc.a:callocr.o(.text);
        *libc.a:closer.o(.text);
        *libc.a:errno.o(.text);
        *libc.a:fstatr.o(.text);
        *libc.a:abort.o(.text);
        *libc.a:libcfunc.o(.text);
        *libc.a:lseekr.o(.text);
        *libc.a:readr.o(.text);
        *libgcc.a:_udivsi3.o(.text);
    } =0

    .rodata :
    ALIGN(4)
    {
        data/data.o(.rodata);
        src/file_system.o(.rodata);
        data/data_80B9BB8.o(.rodata);
        data/data_80EBA18.o(.rodata);
        data/personality_test.o(.rodata);
        src/personality_test.o(.rodata);
        data/data_80F4278.o(.rodata);
        src/m4a_tables.o(.rodata);
        src/agb_flash.o(.rodata);
        src/agb_flash_1m.o(.rodata);
        src/agb_flash_mx.o(.rodata);
        src/agb_flash_le.o(.rodata);
        *libc.a:sprintf.o(.rodata);
        *libc.a:vfprintf.o(.rodata);
        *libc.a:dtoa.o(.rodata);
        *libc.a:impure.o(.rodata);
        *libc.a:locale.o(.rodata);
        *libc.a:mprec.o(.rodata);
        *libc.a:syscalls.o(.rodata);
        . = ALIGN(4);
        data/data_8270000.o(.rodata);
    } =0

    unk_code_section :
    ALIGN(4)
    {
        unk_code = .;
        asm/code_8272724.o(.rodata);
        src/code_8272724.o(.text);
        asm/code_8272724.o(.text);
        unk_code_end = .;
    }

    unk_code_section_size = (unk_code_end - unk_code);
    unk_code_ram_end = unk_code_ram + unk_code_section_size;
    end = unk_code_ram_end;

    . = 0x8300000;
    unk_data :
    ALIGN(4)
    {
        data/unk_data.o(.rodata);
    }

    . = 0x8300500;
    system_sbin_section :
    ALIGN(4)
    {
        data/system_sbin.o(.rodata);
    }

    . = 0x8380000;
    titlemenu_sbin_section :
    ALIGN(4)
    {
        data/titlemenu_sbin.o(.rodata);
    }

    . = 0x83B0000;
    dungeon_sbin_section :
    ALIGN(4)
    {
        data/dungeon_sbin.o(.rodata);
    }

    . = 0x8510000;
    monster_sbin_section :
    ALIGN(4)
    {
        data/monster_sbin.o(.rodata);
    }

    . = 0x9740000;
    effect_sbin_section :
    ALIGN(4)
    {
        data/effect_sbin.o(.rodata);
    }

    . = 0x9890000;
    ground_sbin_section :
    ALIGN(4)
    {
        data/ground_sbin.o(.rodata);
    }

    . = 0x9E60000;
    ornament_sbin_section :
    ALIGN(4)
    {
        data/ornament_sbin.o(.rodata);
    }

    sound_data :
    ALIGN(4)
    {
        data/sound_data.o(.rodata);
    }

    /* DWARF 2 sections */
    .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) }

    /* Discard everything not specifically mentioned above. */
    /DISCARD/ :
    {
        *(*);
    }
}