-
Notifications
You must be signed in to change notification settings - Fork 8
/
portal.ld
91 lines (74 loc) · 1.98 KB
/
portal.ld
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
OUTPUT_ARCH (mips)
#define BEGIN_SEG(name, addr) \
_##name##SegmentStart = ADDR(.name); \
_##name##SegmentRomStart = __romPos; \
.name addr : AT(__romPos)
#define END_SEG(name) \
_##name##SegmentEnd = ADDR(.name) + SIZEOF(.name); \
_##name##SegmentRomEnd = __romPos + SIZEOF(.name); \
__romPos += SIZEOF(.name);
#define BEGIN_NOLOAD(name) \
_##name##SegmentBssStart = ADDR(.name.noload); \
.name.noload (NOLOAD) :
#define END_NOLOAD(name) \
_##name##SegmentBssEnd = ADDR(.name.noload) + SIZEOF(.name.noload); \
_##name##SegmentBssSize = SIZEOF(.name.noload);
SECTIONS
{
__romPos = 0;
BEGIN_SEG(boot, 0x04000000)
{
build/asm/rom_header.o(.text);
build/boot.6102.o(.data);
}
END_SEG(boot)
BEGIN_SEG(code, 0x80000400) SUBALIGN(16)
{
build/asm/entry.o(.text);
CODE_SEGMENT(.text);
/usr/lib/n64/PR/rspboot.o(.text);
/usr/lib/n64/PR/gspF3DEX2.fifo.o(.text);
/usr/lib/n64/PR/aspMain.o(.text);
/* data */
CODE_SEGMENT(.data*);
/usr/lib/n64/PR/rspboot.o(.data*);
/usr/lib/n64/PR/gspF3DEX2.fifo.o(.data*);
/usr/lib/n64/PR/aspMain.o(.data*);
/* rodata */
CODE_SEGMENT(.rodata*);
}
END_SEG(code)
BEGIN_NOLOAD(code)
{
CODE_SEGMENT(COMMON);
CODE_SEGMENT(.scommon*);
CODE_SEGMENT(.bss*);
. = ALIGN(0x8);
}
END_NOLOAD(code)
_codeSegmentBssEnd = .;
_heapStart = .;
. = 0x80200000;
BEGIN_SEG(sound_data, __romPos)
{
build/asm/sound_data.o(.data);
build/asm/sound_data.o(.bss);
}
END_SEG(sound_data)
BEGIN_SEG(images, __romPos)
{
build/assets/materials/images_mat.o(.data);
build/assets/materials/images_mat.o(.bss);
}
END_SEG(images)
#include "build/levels.ld"
#include "build/dynamic_models.ld"
#include "build/anims.ld"
#include "build/subtitles.ld"
/* Discard everything not specifically mentioned above. */
/DISCARD/ :
{
*(.eh_frame)
*(.MIPS.abiflags)
}
}