-
Notifications
You must be signed in to change notification settings - Fork 1
/
z64ovl.ld
105 lines (80 loc) · 1.79 KB
/
z64ovl.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
INCLUDE entry.ld
/* Libaries here -- add your own if you need to*/
SEARCH_DIR( /usr/mips/mips/lib )
SEARCH_DIR( /usr/mips/lib/gcc/mips/3.4.6/ )
/* This script is for MIPS */
OUTPUT_ARCH( mips )
OUTPUT_FORMAT( "elf32-bigmips", "elf32-bigmips", "elf32-littlemips" )
/* Entrypoint is function `n64start` */
ENTRY( ENTRY_POINT )
SECTIONS
{
/* Program run addressed defined in `entry.ld` */
. = ENTRY_POINT;
/* Machine code */
.text ALIGN( 4 ):
{
/* Pad with NULL */
FILL( 0 );
/* Address to start of text section */
__text_start = . ;
/* Data goes here */
*(.init);
*(.text);
*(.ctors);
*(.dtors);
*(.fini);
/* Address to end of text section */
. = ALIGN( 16 );
__text_end = . ;
}
/* Initialized data */
.data ALIGN( 16 ):
{
/* Pad with NULL */
FILL( 0 );
/* Address to start of data section */
__data_start = . ;
/* Data goes here*/
*(.data);
*(.data.*);
/* Data pointer */
. = ALIGN( 8 );
_gp = . ;
*(.sdata);
/* Address to end of data section */
. = ALIGN( 16 );
__data_end = . ;
}
/* Read-only data */
.rodata ALIGN( 16 ):
{
/* Pad with NULL */
FILL( 0 );
/* Address to start of rodata section */
__rodata_start = . ;
/* Data goes here*/
*(.rodata);
*(.rodata.*);
*(.eh_frame);
/* Address to end of rodata section */
. = ALIGN( 16 );
__rodata_end = . ;
}
/* Memory initialized to zero */
.bss ALIGN( 8 ):
{
/* Address to start of BSS section */
__bss_start = . ;
/* BSS data */
*(.scommon);
*(.sbss);
*(.bss);
/* Address to end of BSS section */
. = ALIGN( 8 );
__bss_end = . ;
}
/* End of our memory use */
. = ALIGN( 8 );
end = . ;
}