summaryrefslogtreecommitdiff
path: root/ld_scripts/generated.ld.j2
blob: ded6f1c3f25c04244b4dd9334ac6087dda2b771f (plain)
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
/*
 * This file is auto-generated from a template!
 * You should reconsider editing!
 */
MEMORY {
    {% for name, m in mem.items() %}
        {{ name }} ({{ 'rx' if name == 'flash' else 'rwx' }}) : org = {{ m.origin | hex }}, len = {{ m.size | size_prefix }}
    {% endfor %}
}

SECTIONS {
	. = 0;
	
	.vectors : ALIGN(16) SUBALIGN(16) {
		KEEP(*(.vectors))
	} > flash
	
	.init_array : ALIGN(4) SUBALIGN(4) {
		PROVIDE(_init_array_start = .);
		KEEP(*(SORT(.init_array.*)))
		KEEP(*(.init_array))
		PROVIDE(_init_array_end = .);
	} > flash
	
	.fini_array : ALIGN(4) SUBALIGN(4) {
		PROVIDE(_fini_array_start = .);
		KEEP(*(.fini_array))
		KEEP(*(SORT(.fini_array.*)))
		PROVIDE(_fini_array_end = .);
	} > flash
	
	.text : ALIGN(4) SUBALIGN(4) {
		*(.text.startup.*)
		*(.text)
		*(.text.*)
		*(.rodata)
		*(.rodata.*)
		*(.srodata)
		*(.srodata.*)
		*(.glue_7t)
		*(.glue_7)
		*(.gcc*)
	} > flash
	
	.bootinfo : ALIGN(4) SUBALIGN(4) {
		*(.bootinfo)
	} > ram
	
	. = ALIGN(4);
	
	.data : ALIGN(4) SUBALIGN(4) {
		PROVIDE(_data_start = .);
		*(.data)
		*(.data.*)
		*(.sdata)
		*(.sdata.*)
		*(.ramtext)
		PROVIDE(_data_end = .);
	} > ram AT > flash
	
	.bss : {
		PROVIDE(_bss_start = .);
		*(.bss)
		*(.bss.*)
		*(.sbss)
		*(.sbss.*)
		*(COMMON)
		PROVIDE(_bss_end = .);
	} > ram    
	
	PROVIDE(_ram_end = ORIGIN(ram) + LENGTH(ram));

	PROVIDE(_data_rom = LOADADDR(.data));
}