-
Notifications
You must be signed in to change notification settings - Fork 11
/
linker.ld
56 lines (45 loc) · 1.51 KB
/
linker.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
/* Copyright (c) Codethink Ltd. All rights reserved.
Licensed under the MIT License. */
MEMORY
{
TCM (rwx) : ORIGIN = 0x00100000, LENGTH = 192K
SYSRAM (rwx) : ORIGIN = 0x22000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 1M
}
/* The data and BSS regions can be placed in TCM or SYSRAM. The code and read-only regions can
be placed in TCM, SYSRAM, or FLASH. See
https://docs.microsoft.com/en-us/azure-sphere/app-development/memory-latency for information
about which types of memory which are available to real-time capable applications on the
MT3620, and when they should be used. */
REGION_ALIAS("CODE_REGION", TCM);
REGION_ALIAS("RODATA_REGION", TCM);
REGION_ALIAS("DATA_REGION", TCM);
REGION_ALIAS("BSS_REGION", TCM);
ENTRY(ExceptionVectorTable)
SECTIONS
{
/* The exception vector's virtual address must be aligned to a power of two,
which is determined by its size and set via CODE_REGION. See definition of
ExceptionVectorTable in main.c.
When the code is run from XIP flash, it must be loaded to virtual address
0x10000000 and be aligned to a 32-byte offset within the ELF file. */
.text : ALIGN(32) {
KEEP(*(.vector_table))
*(.text)
} >CODE_REGION
.rodata : {
*(.rodata)
} >RODATA_REGION
.data : {
*(.data)
} >DATA_REGION
.bss : {
*(.bss)
} >BSS_REGION
.sysram : {
*(.sysram)
} >SYSRAM
. = ALIGN(4);
end = . ;
StackTop = ORIGIN(TCM) + LENGTH(TCM);
}