File size: 1,328 Bytes
546acd4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/* The GBA's memory: cartridge ROM (weights and code), 32 KB of fast internal
   work RAM (the runner's mailbox first, at 0x03000000, then the hot code and
   working vectors; the top 4 KB is left to the stacks), and 256 KB of external
   work RAM (the KV cache and canon histories). */
OUTPUT_FORMAT("elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)

MEMORY {
    rom   : ORIGIN = 0x08000000, LENGTH = 32M
    iwram : ORIGIN = 0x03000000, LENGTH = 0x7000
    ewram : ORIGIN = 0x02000000, LENGTH = 256K
}

SECTIONS {
    .text : {
        KEEP(*(.crt0))
        *(.text .text.*)
        *(.rodata .rodata.*)
        . = ALIGN(4);
    } > rom

    .shared (NOLOAD) : {
        __shared_start = .;
        KEEP(*(.shared))
        . = ALIGN(4);
        __shared_end = .;
    } > iwram

    .iwram : {
        __iwram_start = .;
        *(.iwram.text)
        *(.data .data.*)
        . = ALIGN(4);
        __iwram_end = .;
    } > iwram AT > rom
    __iwram_lma = LOADADDR(.iwram);

    /* Before .bss, so that it claims .bss.ewram first. */
    .ewram (NOLOAD) : {
        *(.bss.ewram)
        . = ALIGN(4);
    } > ewram

    .bss (NOLOAD) : {
        __bss_start = .;
        *(.bss .bss.* COMMON)
        . = ALIGN(4);
        __bss_end = .;
    } > iwram

    /DISCARD/ : { *(.ARM.exidx*) *(.ARM.attributes) *(.comment) }
}