My actor.rpg avatar walking around on a GBA game
1OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
2OUTPUT_ARCH(arm)
3
4ENTRY(__start)
5EXTERN(__RUST_INTERRUPT_HANDLER)
6
7EXTERN(__agbabi_memset)
8EXTERN(__agbabi_memcpy)
9
10MEMORY {
11 ewram (w!x) : ORIGIN = 0x02000000, LENGTH = 256K
12 iwram (w!x) : ORIGIN = 0x03000000, LENGTH = 32K
13 rom (rx) : ORIGIN = 0x08000000, LENGTH = 32M
14}
15
16__text_start = ORIGIN(rom);
17
18INPUT (agb.a)
19
20SECTIONS {
21 . = __text_start;
22
23
24 .text : {
25 KEEP(*(.crt0));
26 *(.crt0 .crt0*);
27 *(.text .text*);
28 . = ALIGN(4);
29 } > rom
30 __text_end = .;
31
32 .rodata : {
33 *(.rodata .rodata.*);
34 . = ALIGN(4);
35 } > rom
36
37 __iwram_rom_start = .;
38 .iwram : {
39 __iwram_data_start = ABSOLUTE(.);
40
41 *(.iwram .iwram.*);
42 . = ALIGN(4);
43
44 *(.text_iwram .text_iwram.*);
45 . = ALIGN(4);
46
47 __iwram_data_end = ABSOLUTE(.);
48 } > iwram AT>rom
49
50 . = __iwram_rom_start + (__iwram_data_end - __iwram_data_start);
51
52 __ewram_rom_start = .;
53 .ewram : {
54 __ewram_data_start = ABSOLUTE(.);
55
56 *(.ewram .ewram.*);
57 . = ALIGN(4);
58
59 *(.data .data.*);
60 . = ALIGN(4);
61
62 __ewram_data_end = ABSOLUTE(.);
63 } > ewram AT>rom
64
65 .bss : {
66 *(.bss .bss.*);
67 . = ALIGN(4);
68 __iwram_end = ABSOLUTE(.);
69 } > iwram
70
71 __iwram_rom_length_bytes = __iwram_data_end - __iwram_data_start;
72 __iwram_rom_length_halfwords = (__iwram_rom_length_bytes + 1) / 2;
73
74 __ewram_rom_length_bytes = __ewram_data_end - __ewram_data_start;
75 __ewram_rom_length_halfwords = (__ewram_rom_length_bytes + 1) / 2;
76
77 /* debugging sections */
78 /* Stabs */
79 .stab 0 : { *(.stab) }
80 .stabstr 0 : { *(.stabstr) }
81 .stab.excl 0 : { *(.stab.excl) }
82 .stab.exclstr 0 : { *(.stab.exclstr) }
83 .stab.index 0 : { *(.stab.index) }
84 .stab.indexstr 0 : { *(.stab.indexstr) }
85 .comment 0 : { *(.comment) }
86 /* DWARF 1 */
87 .debug 0 : { *(.debug) }
88 .line 0 : { *(.line) }
89 /* GNU DWARF 1 extensions */
90 .debug_srcinfo 0 : { *(.debug_srcinfo) }
91 .debug_sfnames 0 : { *(.debug_sfnames) }
92 /* DWARF 1.1 and DWARF 2 */
93 .debug_aranges 0 : { *(.debug_aranges) }
94 .debug_pubnames 0 : { *(.debug_pubnames) }
95 /* DWARF 2 */
96 .debug_info 0 : { *(.debug_info) }
97 .debug_abbrev 0 : { *(.debug_abbrev) }
98 .debug_line 0 : { *(.debug_line) }
99 .debug_frame 0 : { *(.debug_frame) }
100 .debug_str 0 : { *(.debug_str) }
101 .debug_loc 0 : { *(.debug_loc) }
102 .debug_macinfo 0 : { *(.debug_macinfo) }
103 /* SGI/MIPS DWARF 2 extensions */
104 .debug_weaknames 0 : { *(.debug_weaknames) }
105 .debug_funcnames 0 : { *(.debug_funcnames) }
106 .debug_typenames 0 : { *(.debug_typenames) }
107 .debug_varnames 0 : { *(.debug_varnames) }
108
109 .debug_ranges 0 : { *(.debug_ranges) }
110
111 /* discard anything not already mentioned */
112 /DISCARD/ : { *(*) }
113}