forked from andwn/cave-story-md
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mdssf.ld
74 lines (68 loc) · 1.67 KB
/
mdssf.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
OUTPUT_ARCH(m68k)
SEARCH_DIR(.)
/*
* Setup the memory map of the SEGA Genesis.
* stack grows down from high memory.
*
* The memory map look like this:
* +--------------------+ <- low memory
* | .text |
* | _stext |
* +--------------------+
* | .data (ROM) | initialized vars, copied to .data
* +--------------------+
* | .rodata | Non-code data that can be put in far chunks
* | _srodata |
* +--------------------+ <- end of ROM
* . .
* . .
* . .
* +--------------------+ <- 0xFFFF0000
* | .data (RAM) | initialized data goes here
* | _sdata |
* +--------------------+
* | .bss |
* | _bss_start | start of bss
* | _bss_end | start of heap, for malloc()
* +--------------------+
* . .
* . .
* . .
* | __stack | top of stack
* +--------------------+ <- 0x(1)00000000
*/
MEMORY
{
rom : ORIGIN = 0x00000000, LENGTH = 0x02000000
ram : ORIGIN = 0xFFFF0000, LENGTH = 0x00010000
}
PROVIDE (__stack = 0x00000000);
SECTIONS
{
.text 0x00000000:
{
KEEP(*(.text.keepboot)) *(.text.*) *(.text)
. = ALIGN(0x2);
} > rom
_stext = SIZEOF(.text);
.data 0xFFFF0000:
AT ( SIZEOF(.text) )
{
*(.data .data.*)
. = ALIGN(0x2);
} > ram
_sdata = SIZEOF(.data);
.rodata 0x00000000 + SIZEOF(.text) + SIZEOF(.data):
{
*(.rodata .rodata.*)
. = ALIGN(0x2);
} > rom
_srodata = SIZEOF(.rodata);
.bss 0xFFFF0000 + SIZEOF(.data):
{
_bss_start = . ;
*(.bss .bss.*)
. = ALIGN(0x2);
_bss_end = . ;
} > ram
}