1/*        $NetBSD: kern.ldscript,v 1.1 2021/08/30 18:59:57 christos Exp $       */
2
3#include "assym.h"
4
5__PAGE_SIZE = 0x1000 ;
6
7ENTRY(_start)
8SECTIONS
9{
10          .text : AT (ADDR(.text) & 0x0fffffff)
11          {
12                    KEEP(*(.text._start));
13                    . = ALIGN(__PAGE_SIZE);
14                    __text_user_start = . ;
15                    *(.text.user)
16                    . = ALIGN(__PAGE_SIZE);
17                    __text_user_end = . ;
18
19                    *(.text)
20                    *(.text.*)
21                    *(.stub)
22                    . = ALIGN(__PAGE_SIZE);
23          } =0xCC
24          _etext = . ;
25          PROVIDE (etext = .) ;
26
27          /*
28           * Push the rodata segment up to the next large page boundary so that we
29           * can map the text segment with large pages.
30           */
31          . = ALIGN(__PAGE_SIZE);
32
33          __rodata_start = . ;
34
35          .rodata :
36          {
37                    *(.rodata)
38                    *(.rodata.*)
39                    . = ALIGN(COHERENCY_UNIT);
40                    __CTOR_LIST__ = .;
41                    *(.ctors)
42                    __CTOR_END__ = .;
43          }
44
45          . = ALIGN(__PAGE_SIZE);
46
47          __data_start = . ;
48          .data :
49          {
50                    *(.data)
51          }
52
53          . = ALIGN(COHERENCY_UNIT);
54          .data.cacheline_aligned :
55          {
56                    *(.data.cacheline_aligned)
57          }
58          . = ALIGN(COHERENCY_UNIT);
59          .data.read_mostly :
60          {
61                    *(.data.read_mostly)
62          }
63          . = ALIGN(COHERENCY_UNIT);
64
65          _edata = . ;
66          PROVIDE (edata = .) ;
67          __bss_start = . ;
68          .bss :
69          {
70                    *(.bss)
71                    *(.bss.*)
72                    *(COMMON)
73                    . = ALIGN(__PAGE_SIZE);
74          }
75
76          . = ALIGN(__PAGE_SIZE);
77
78          /* End of the kernel image */
79          __kernel_end = . ;
80
81          _end = . ;
82          PROVIDE (end = .) ;
83          .note.netbsd.ident :
84          {
85                    KEEP(*(.note.netbsd.ident));
86          }
87}
88
89