-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemory.ld
82 lines (69 loc) · 1.49 KB
/
memory.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
ENTRY(start);
/* RX631, 2MB ROM, 256KB RAM */
_device_ram_size = 256 * 1024;
_device_rom_size = 2 * 1024 * 1024;
MEMORY
{
/* Avoid placing data at PA 0 */
OCRAM : ORIGIN = 0x00000000 + 1, LENGTH = _device_ram_size - 1,
/* The last 32KB is occupied by "Internal Flash ROM rewrite program via USB Mass Storage" */
OCROM : ORIGIN = 0x100000000 - _device_rom_size, LENGTH = _device_rom_size - 0x8000
}
SECTIONS
{
.userapp_hdr :
{
KEEP(*(.userapp_hdr .userapp_hdr.*));
} > OCROM
.text :
{
*(.text .text.*);
__etext = .;
} > OCROM
.rodata :
{
*(.rodata .rodata.*);
. = ALIGN(4);
} > OCROM
.data : ALIGN(4)
{
__sdata = .;
*(.data .data.*);
. = ALIGN(4);
__edata = .;
} > OCRAM AT> OCROM
/* LMA of .data */
__sidata = LOADADDR(.data);
.bss : ALIGN(4)
{
__sbss = .;
*(.bss .bss.*);
. = ALIGN(4);
__ebss = .;
} > OCRAM
/* Stacks */
. += 4096;
. = ALIGN(4);
_ustack_start = .;
. += 4096;
. = ALIGN(4);
_istack_start = .;
/* Place the heap right after `.uninit` */
. = ALIGN(4);
__sheap = .;
/* ## .got */
/* Dynamic relocations are unsupported. This section is only used to detect relocatable code in
the input files and raise an error if relocatable code is found */
.got (NOLOAD) :
{
KEEP(*(.got .got.*));
}
/* ## Discarded sections */
/DISCARD/ :
{
/* Unused exception related info that only wastes space */
*(.ARM.exidx);
*(.ARM.exidx.*);
*(.ARM.extab.*);
}
}