summaryrefslogtreecommitdiff
path: root/src/ld/virt.ld
blob: 33532c4a91f260e2cea87a48872082f04235753c (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
OUTPUT_ARCH( "riscv" )
ENTRY( _start )

MEMORY
{
	ram : org = 0x80000000, len = 128M
}

SECTIONS
{
	.text : {
		_text_start = .;
		*(.text.init)
		*(.text .text.*)
		_text_end = .;
	} >ram

	.rodata : {
		_rodata_start = .;
		*(.rodata .rodata.*)
		_rodata_end = .;
	} >ram

	.data : {
		. = ALIGN(4096);
		_data_start = .;
		*(.sdata .sdata.*)
		*(.data .data.*)
		_data_end = .;
	} >ram

	.bss : {
		_bss_start = .;
		*(.sbss .sbss.*)
		*(.bss .bss.*)
		_bss_end = .;
	} >ram

	. = ALIGN(4096);
	_stack_start = .;
	_stack_end = . + 0x80000;
	_heap_start = _stack_end;
	_memory_end = ORIGIN(ram) + LENGTH(ram);
	_heap_size = _memory_end - _heap_start;
}