-
Notifications
You must be signed in to change notification settings - Fork 0
/
linking.ld
101 lines (87 loc) · 2.7 KB
/
linking.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
_vStackTop = ORIGIN(VirtDataM4) + LENGTH(VirtDataM4) - 1;
_vShadowMapM4 = __CopyTextM4;
_vShadowMapM0 = __CopyTextM0;
_ResetISR_load = ResetISR;
ENTRY(_ResetISR_load)
SECTIONS
{
. = ORIGIN(VirtTextM4);
.text_M4 : ALIGN(4)
{
FILL(0xff)
__vectors_start__ = ABSOLUTE(.) ;
KEEP(*(.isr_vector))
. = ALIGN(4) ;
/* markers for initialising data and bss */
__section_table_start = .;
__text_section_table = .;
LONG(LOADADDR(.text_M4));
LONG(__CopyTextM4);
LONG( SIZEOF(.text_M4));
LONG(LOADADDR(.text_M0));
LONG(__CopyTextM0);
LONG( SIZEOF(.text_M0));
__text_section_table_end = .;
__data_section_table = .;
LONG(LOADADDR(.data_M4));
LONG( ADDR(.data_M4));
LONG( SIZEOF(.data_M4));
LONG(LOADADDR(.data_M0));
LONG( ADDR(.data_M0));
LONG( SIZEOF(.data_M0));
__data_section_table_end = .;
__bss_section_table = .;
LONG( ADDR(.bss_M4));
LONG( SIZEOF(.bss_M4));
__bss_section_table_end = .;
__section_table_end = . ;
*(.after_vectors*)
*(.text*)
} > VirtTextM4 AT > LoadTextM4
. = ORIGIN(VirtDataM4);
.data_M4 : ALIGN(4)
{
*(.data*)
*(.rodata .rodata.* .constdata .constdata.*)
. = ALIGN(4);
} > VirtDataM4 AT > LoadDataM4
/* for exception handling/unwind - some Newlib functions (in common with C++ and STDC++) use this */
.ARM.extab (NOLOAD) : ALIGN(4)
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > VirtDataM4
__exidx_start = .;
.ARM.exidx (NOLOAD) : ALIGN(4)
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > VirtDataM4
__exidx_end = .;
.bss_M4 (NOLOAD) : ALIGN(4)
{
_bss = .;
*(.bss*)
*(COMMON)
. = ALIGN(4) ;
_ebss = .;
PROVIDE(end = .);
} > VirtDataM4
. = ORIGIN(VirtTextM0);
.text_M0 : ALIGN(4)
{
FILL(0xff)
__core_m0app_START__ = .; /* start of slave image */
KEEP(*(.M0_text))
__core_m0app_END__ = .; /* end of slave image */
ASSERT(!(__core_m0app_START__ == __core_m0app_END__), "No slave code for _core_m0app");
ASSERT( (ABSOLUTE(__core_m0app_START__) == __vectors_start_m0), "M0APP execute address differs from address provided in source image");
} > VirtTextM0 AT > LoadTextM0
. = ORIGIN(VirtDataM0);
.data_M0 : ALIGN(4)
{
KEEP(*(.M0_data))
} > VirtDataM0 AT > LoadDataM0
.bss_M0 (NOLOAD): ALIGN(4)
{
KEEP(*(.M0_bss))
} > VirtDataM0
}