-
Notifications
You must be signed in to change notification settings - Fork 1
/
mdbasic.ld
85 lines (70 loc) · 1.54 KB
/
mdbasic.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
/*
* Simple linker script supporting multitasking. To do that, two stacks are
* defined (__ustack and __stack). These symbols are e used in sega.s to set
* up the stacks.
*/
OUTPUT_ARCH(m68k)
SEARCH_DIR(.)
__DYNAMIC = 0;
PROVIDE (_rom_start = 0x00000000);
PROVIDE (_ram_start = 0x00FF0000);
MEMORY
{
rom (rx) : ORIGIN = _rom_start, LENGTH = 0x00400000
ram : ORIGIN = _ram_start, LENGTH = 0x00010000
}
/*
* allocate the stacks at the top of memory, since the stack
* grows down on m68k
*/
PROVIDE (__ustack = 0x01000000); /* user stack, 512 bytes */
PROVIDE (__stack = 0x00FFFE00); /* privileged stack */
SECTIONS
{
/* Code and read-only data */
.text _rom_start :
{
/* Make sure boot sector is not discarded by the linker */
KEEP(*(.text.boot)) *(.text .text.*)
. = ALIGN(4);
*(.rodata .rodata.*)
. = ALIGN(0x4);
__INIT_SECTION__ = . ;
*(.init)
SHORT (0x4E75) /* rts */
__FINI_SECTION__ = . ;
*(.fini)
SHORT (0x4E75) /* rts */
_etext = .;
} > rom
_stext = SIZEOF(.text);
_rom_end = .;
.data _ram_start :
AT ( ADDR (.text) + _stext )
{
*(.data .data.*)
. = ALIGN(0x4);
_edata = . ;
} > ram
_sdata = SIZEOF(.data);
.bss _edata :
{
_obss = . ;
*(.bss .bss.*)
*(COMMON)
. = ALIGN(0x4);
_ebss = . ;
} > ram
.stab 0 (NOLOAD) :
{
*(.stab)
}
.stabstr 0 (NOLOAD) :
{
*(.stabstr)
}
.eh_frame 0 (NOLOAD) :
{
*(.eh_frame)
}
}