forked from Wolfvak/arm9linuxfw
-
Notifications
You must be signed in to change notification settings - Fork 5
/
link.ld
67 lines (57 loc) · 1.4 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
OUTPUT_FORMAT("elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(__start)
MEMORY
{
AHBRAM (RWX) : ORIGIN = 0x08080000, LENGTH = 64K
VECTOR (RWX) : ORIGIN = 0x08000000, LENGTH = 64
ITCM (RWX) : ORIGIN = 0x01FF8000, LENGTH = 32K
DTCM (RW) : ORIGIN = 0x40000000, LENGTH = 16K
}
SECTIONS
{
.bootstrap : ALIGN(16)
{
__bootstrap_start = ABSOLUTE(.);
KEEP(*(.bootstrap))
. = ALIGN(16);
} >AHBRAM
/* .vector, .text and .data get relocated on boot */
.vector : ALIGN(16)
{
__vector_lma = LOADADDR(.vector);
__vector_s = ABSOLUTE(.);
KEEP(*(.vector))
. = ALIGN(16);
__vector_e = ABSOLUTE(.);
} >VECTOR AT>AHBRAM
.text : ALIGN(16)
{
__text_lma = LOADADDR(.text);
__text_s = ABSOLUTE(.);
KEEP(*(.text.vectors))
*(.text*)
. = ALIGN(16);
__text_e = ABSOLUTE(.);
} >ITCM AT>AHBRAM
.data : ALIGN(16)
{
__data_lma = LOADADDR(.data);
__data_s = ABSOLUTE(.);
*(.data*)
*(.rodata*)
. = ALIGN(16);
__vdev_s = ABSOLUTE(.);
KEEP(*(.vdev_list));
__vdev_cnt = (ABSOLUTE(.) - __vdev_s) / 4;
. = ALIGN(16);
__data_e = ABSOLUTE(.);
} >DTCM AT>AHBRAM
.bss (NOLOAD) : ALIGN(16)
{
__bss_s = ABSOLUTE(.);
*(.bss*)
. = ALIGN(16);
__bss_e = ABSOLUTE(.);
} >DTCM
}