-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink.ld
97 lines (75 loc) · 1.79 KB
/
link.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
__rc0 = 0x00;
INCLUDE imag-regs.ld
MEMORY {
zp : ORIGIN = __rc31 + 1, LENGTH = 0x100 - (__rc31 + 1)
ram : ORIGIN = 0x200, LENGTH = 0x1e00
rom : ORIGIN = 0x8000, LENGTH = 0x4000
vec : ORIGIN = 0xFFFa, LENGTH = 0x0006
}
__stack = 0x800;
ENTRY(_start)
SECTIONS {
.text : {
*(.text)
*(.text.*)
/* A sorted list of initialization function pointers. Used for GCC
* constructor attribute and C++ global constructors. */
__init_array_start = .;
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.* .init_array)))
__init_array_end = .;
/* A sorted list of finalization function pointers. Used for GCC destructor
* attribute. */
__fini_array_start = .;
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.* .fini_array)))
__fini_array_end = .;
} >rom
.rodata : {
*(.rodata)
*(.rodata.*)
} >rom
.data : {
__data_start = .;
*(.data)
*(.data.*)
} >ram AT>rom
__data_load_start = LOADADDR(.data);
__data_size = SIZEOF(.data);
.zp.data : {
__zp_data_start = .;
*(.zp.data)
*(.zp.data.*)
*(.zp.rodata)
*(.zp.rodata.*)
} >zp AT>rom
__zp_data_load_start = LOADADDR(.zp.data);
__zp_data_size = SIZEOF(.zp.data);
.zp.bss (NOLOAD) : {
__zp_bss_start = .;
*(.zp.bss)
*(.zp.bss.*)
} >zp
__zp_bss_size = SIZEOF(.zp.bss);
.zp (NOLOAD) : {
*(.zp)
*(.zp.*)
*(.zeropage)
*(.zeropage.*)
*(.directpage)
*(.directpage.*)
} >zp
.bss (NOLOAD) : {
__bss_start = .;
*(.bss)
*(.bss.*)
*(COMMON)
__bss_end = .;
} >ram
__bss_size = SIZEOF(.bss);
.noinit (NOLOAD) : {
*(.noinit)
*(.noinit.*)
__heap_start = .;
} >ram
.prg_rom_fixed : { *(.prg_rom_fixed .prg_rom_fixed.*) } >rom
.vector 0xfffa : { SHORT(nmi) SHORT(_start) SHORT(irq) } >vec
}