summaryrefslogtreecommitdiff
path: root/kernel/link.ld
blob: 884e6333924fad0e4f295cf4af9ec680a535f831 (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
OUTPUT_FORMAT(elf64-x86-64)
OUTPUT_ARCH(i386:x86-64)

ENTRY(entry)

PHDRS {
  rx PT_LOAD FLAGS(5);
  ro PT_LOAD FLAGS(4);
  rw PT_LOAD FLAGS(6);
}

SECTIONS {

  /* see also ../documentation/memory.txt */
  . = 0xffffffffc0000000;
  __kernel_rx_start = .;

  .text : {
    *(.text .text.*)
  } : rx

  . = ALIGN(4096);
  __kernel_rx_end = .;
  __kernel_ro_start = .;

  .rodata : {
    *(.rodata .rodata.*)
  } : ro

  . = ALIGN(4096);
  __kernel_ro_end = .;
  __kernel_rw_start = .;

  .data : {
    *(.data .data.*)
  } : rw

  . = ALIGN(4096);
  .bss : {
    *(.bss .bss.*)
    *(COMMON)
  } : rw

  . = ALIGN(4096);
  __kernel_rw_end = .;

}