summaryrefslogtreecommitdiff
path: root/sys/kern/kernel.lds
blob: 2e2fe29de08325ee8757f1b7de748fd77f1f025c (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
OUTPUT_ARCH(riscv)
ENTRY(_start)

SECTIONS
{
        . = LOAD_ADDR;
        . = ALIGN(PAGE_SIZE);

        .text :
        {
                PROVIDE(__text_start = .);
                *(.text.init)
                *(.text .text.*)
                . = ALIGN(8);
                PROVIDE(__text_end = .);
        }
        . = ALIGN(PAGE_SIZE);

        PROVIDE(__global_pointer$ = .);

        .rodata :
        {
                PROVIDE(__rodata_start = .);
                *(.rodata .rodata.*)
                . = ALIGN(8);
                PROVIDE(__rodata_end = .); 
        }

        . = ALIGN(PAGE_SIZE);

        .data : 
        {
                PROVIDE(__data_start = .);
                *(.sdata .sdata.*) 
                *(.data .data.*)
                *(.readmostly.data)
                *(*.data)
                . = ALIGN(8);
                PROVIDE(__data_end = .);
        }

        . = ALIGN(PAGE_SIZE); 

	.bss :
	{
		PROVIDE(__bss_start = .);
		*(.sbss .sbss.*)
		*(.bss .bss.*)
		. = ALIGN(8);
		PROVIDE(__bss_end = .);
	}

	. = ALIGN(PAGE_SIZE);

        PROVIDE(__stack_start = .);
        PROVIDE(__stack_end = __stack_start + (PAGE_SIZE * NPROC));
        PROVIDE(__heap_start = __stack_end);
}