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

SECTIONS {
    . = 0x2000000;

    ewram (NOLOAD) :
    ALIGN(4)
    {
        ewram_start = .;
        <EWRAM>
        . = ALIGN(4);
        src/agb_flash.o(.bss);
        . = ALIGN(4);
        tools/agbcc/lib/libgcc.a:fp-bit.o(.bss);
        . = ALIGN(4);
        tools/agbcc/lib/libgcc.a:dp-bit.o(.bss);
		. = ALIGN(8); /* 0x39e18 */
        <EWRAM2>
        . = 0x40000;
    }

    . = 0x3000000;

    iwram (NOLOAD) :
    ALIGN(4)
    {
        iwram_start = .;
        <IWRAM>
        . = 0x8000;
    }

    . = 0x8000000;

    .text :
    ALIGN(4)
    {
        asm/crt0.o(.text);
        asm/code.o(.text);
        asm/event_flag.o(.text);
        asm/code_8002774.o(.text);
        src/memory.o(.text);
        asm/memory.o(.text);
        asm/code_80035F0.o(.text);
        src/other_random.o(.text);
        src/util.o(.text);
        asm/bg_palette_buffer.o(.text);
        asm/input.o(.text);
        asm/code_8004AA0.o(.text);
        asm/sprite.o(.text);
        asm/code_800558C.o(.text);
        src/random.o(.text);
        asm/text.o(.text);
        asm/code_8009804.o(.text);
        src/file_system.o(.text);
        asm/code_800AAA0.o(.text);
        src/main.o(.text);
        asm/code_800B540.o(.text);
        src/flash.o(.text);
        asm/code_800D090.o(.text);
        asm/save.o(.text);
        asm/code_8012A18.o(.text);
        asm/m4a.o(.text);
        asm/syscall.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);
        tools/agbcc/lib/libgcc.a:_call_via_rX.o(.text);
        tools/agbcc/lib/libgcc.a:_divsi3.o(.text);
        tools/agbcc/lib/libgcc.a:_dvmd_tls.o(.text);
        tools/agbcc/lib/libgcc.a:_fixunssfsi.o(.text);
        tools/agbcc/lib/libgcc.a:_modsi3.o(.text);
        tools/agbcc/lib/libgcc.a:_umodsi3.o(.text);
        tools/agbcc/lib/libgcc.a:fp-bit.o(.text);
        tools/agbcc/lib/libgcc.a:_muldi3.o(.text);
        tools/agbcc/lib/libgcc.a:dp-bit.o(.text);
        tools/agbcc/lib/libgcc.a:_lshrdi3.o(.text);
        tools/agbcc/lib/libgcc.a:_negdi2.o(.text);
        asm/libc.o(.text);
    } =0

    .rodata :
    ALIGN(4)
    {
        data/data.o(.rodata);
        src/file_system.o(.rodata);
        data/data_80B9BB8.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);
        data/libc_data.o(.rodata);
        data/data_8270000.o(.rodata);
    } =0

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

    unk_code_ram_end = unk_code_ram + (unk_code_end - unk_code);
    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/ :
    {
        *(*);
    }
}