-
Notifications
You must be signed in to change notification settings - Fork 2
/
linkfile
121 lines (100 loc) · 2.64 KB
/
linkfile
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
/*
# _____ ___ ____ ___ ____
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.
#
# Linkfile script for ee-ld
*/
ENTRY(__start);
MEMORY {
bios : ORIGIN = 0x00000000, LENGTH = 592K /* 0x00000000 - 0x00094000: BIOS memory & patched area */
bram : ORIGIN = 0x00094000, LENGTH = 432K /* 0x00094000 - 0x00100000: BIOS unused memory */
gram : ORIGIN = 0x00100000, LENGTH = 31M /* 0x00100000 - 0x02000000: GAME memory */
high : ORIGIN = 0x01ee8000, LENGTH = 1120K /* 0x01ee8000 - 0x02000000: */
}
REGION_ALIAS("MAIN_REGION", bram);
END_MAIN_REGION = ORIGIN(MAIN_REGION) + LENGTH(MAIN_REGION);
PHDRS {
text PT_LOAD;
}
SECTIONS {
.text : {
_ftext = . ;
*(.text)
*(.text.*)
*(.gnu.linkonce.t*)
KEEP(*(.init))
KEEP(*(.fini))
QUAD(0)
} >MAIN_REGION :text
PROVIDE(_etext = .);
PROVIDE(etext = .);
/* Global/static constructors and deconstructors. */
.ctors ALIGN(16): {
KEEP(*crtbegin*.o(.ctors))
KEEP(*(EXCLUDE_FILE(*crtend*.o) .ctors))
KEEP(*(SORT(.ctors.*)))
KEEP(*(.ctors))
} >MAIN_REGION
.dtors ALIGN(16): {
KEEP(*crtbegin*.o(.dtors))
KEEP(*(EXCLUDE_FILE(*crtend*.o) .dtors))
KEEP(*(SORT(.dtors.*)))
KEEP(*(.dtors))
} >MAIN_REGION
.reginfo : { *(.reginfo) } >MAIN_REGION
.data ALIGN(128): {
_fdata = . ;
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
SORT(CONSTRUCTORS)
} >MAIN_REGION
/* Static data. */
.rodata ALIGN(128): {
*(.rodata)
*(.rodata.*)
*(.gnu.linkonce.r*)
} >MAIN_REGION
.rdata ALIGN(128): { *(.rdata) } >MAIN_REGION
.gcc_except_table ALIGN(128): { *(.gcc_except_table) } >MAIN_REGION
_gp = ALIGN(128) + 0x7ff0;
.lit4 ALIGN(128): { *(.lit4) } >MAIN_REGION
.lit8 ALIGN(128): { *(.lit8) } >MAIN_REGION
.sdata ALIGN(128): {
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s*)
} >MAIN_REGION
_edata = .;
PROVIDE(edata = .);
/* Uninitialized data. */
.sbss ALIGN(128) : {
_fbss = . ;
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb*)
*(.scommon)
} >MAIN_REGION
.bss ALIGN(128) : {
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b*)
*(COMMON)
} >MAIN_REGION
_end_bss = .;
_end = . ;
PROVIDE(end = .);
.spad 0x70000000: {
*(.spad)
} >MAIN_REGION
/* Symbols needed by crt0.c. */
/* We set a fixed stack size and the pointer for the stack, letting the remaining memory be the heap. */
PROVIDE(_stack_size = 32 * 1024);
PROVIDE(_stack = END_MAIN_REGION - _stack_size);
PROVIDE(_heap_size = -1);
}