summaryrefslogtreecommitdiff
path: root/linker_script.ld
blob: b8d1231b9d121aaec3adc4e1c889229abee6d62b (plain) (blame)
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
ENTRY(reset_handler)

MEMORY
{
	FLASH(rx): ORIGIN = 0x08000000, LENGTH = 64K
	SRAM(rw): ORIGIN = 0x20000000, LENGTH = 20K
}

SECTIONS
{
	.isr_vector :
	{
		KEEP(*(.isr_vector))
	} >FLASH

	.text :
	{
		. = ALIGN(4);
		
		*(.text)
		*(.rodata)
		
		. = ALIGN(4);
		_etext = .;
	} >FLASH

	_sidata = LOADADDR(.data);

	.data :
	{
		. = ALIGN(4);
		_sdata = .;
		
		*(.data)

		. = ALIGN(4);
		_edata = .;
	} >SRAM AT> FLASH

	.bss :
	{
		. = ALIGN(4);
		_sbss = .;
		__bss_start__ = .;
		
		*(.bss)
		
		. = ALIGN(4);
		_ebss = .;
		__bss_end__ = .;
	} >SRAM
}