-
Notifications
You must be signed in to change notification settings - Fork 0
/
t68krc.ld
114 lines (102 loc) · 2.49 KB
/
t68krc.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
106
107
108
109
110
111
112
113
114
/*
* Linker script for ROM on T68KRC SBC
*/
OUTPUT_ARCH(m68k)
OUTPUT(elf32-m68k)
ENTRY(_reset_vector)
/*
* 32K of ROM is copied to zero by hardware at startup.
* We leave vectors at zero, but relocate the rest of the
* ROM to the end of RAM so that it's possible to upload a
* new program at zero.
*
* RAM size on this board is 2M, so we take 32K code + 32K data
* at the end.
*/
MEMORY
{
vectors(rw) : ORIGIN = 0, LENGTH = 1K
loadspace(rw) : ORIGIN = 1K, LENGTH = 31K
runspace(rwx) : ORIGIN = 2M - 64K, LENGTH = 64K
}
PROVIDE(_reset_vector = ORIGIN(loadspace));
SECTIONS
{
.vectors :
{
/* lower m68k vectors */
_vector_base = .;
LONG(_stack_top)
LONG(_reset_vector)
LONG(vector_bus_error)
LONG(vector_address_error)
LONG(vector_illegal_instruction)
LONG(vector_zero_divide)
LONG(vector_chk)
LONG(vector_trapv)
LONG(vector_privilege_violation)
LONG(vector_trace)
LONG(vector_line_a)
LONG(vector_line_f)
. = 0x3c;
LONG(vector_uninitialized_interrupt)
. = 0x60;
LONG(vector_spurious_interrupt)
/* user vectors */
. = 0x100;
LONG(vector_64)
LONG(vector_65)
LONG(vector_66)
LONG(vector_67)
_vector_top = .;
} > vectors
.text ORIGIN(runspace) :
{
_btext = .;
KEEP(*(.entrypoint))
*(.text .text.*);
KEEP(*(INTERRUPT_HANDLERS));
*(.rodata .rodata.*);
. = ALIGN(0x4);
_commands = .;
KEEP(*(COMMANDS))
_ecommands = .;
_etext = .;
*(.lit);
} > runspace AT> loadspace
.data :
{
. = ALIGN(0x4);
*(.got.plt) *(.got);
*(.shdata);
*(.data .data.*);
. = ALIGN(0x4);
_edata = .;
} > runspace AT> loadspace
.bss :
{
. = ALIGN(0x4);
*(.shbss);
*(.bss .bss.*);
*(COMMON);
_vector_savearea = .;
. += _vector_top - _vector_base;
_stack_base = .;
. = ORIGIN(runspace) + LENGTH(runspace);
_stack_top = .;
_ebss = .;
} > runspace
.stab 0 (NOLOAD) :
{
*(.stab);
}
.stabstr 0 (NOLOAD) :
{
*(.stabstr);
}
}
/* parameters for the relocator */
_reloc_source = ORIGIN(loadspace);
_reloc_destination = ORIGIN(runspace);
_reloc_end = ORIGIN(runspace) + LENGTH(runspace);
ASSERT((_stack_top - _stack_base) > 2048, "less than 2K stack available")