xref: /netbsd-src/sys/arch/netwinder/conf/kern.ldscript (revision b5470b48cc191574ecc044e071085ed0d1a24204)
1*b5470b48Suwe/*	$NetBSD: kern.ldscript,v 1.12 2023/12/27 19:58:22 uwe Exp $	*/
2bfca87bbSthorpej
3bfca87bbSthorpejSECTIONS
4bfca87bbSthorpej{
5a9554742Suwe  KERNEL_BASE_phys = 0x00010000;
6a9554742Suwe  KERNEL_BASE_virt = 0xf0010000;
7a9554742Suwe
8bfca87bbSthorpej  /* Kernel start: */
9a9554742Suwe  .start (KERNEL_BASE_phys) :
10bfca87bbSthorpej  {
11bfca87bbSthorpej    *(.start)
12db473b34Suebayasi  }
13bfca87bbSthorpej
14bfca87bbSthorpej  /* Read-only sections, merged into text segment: */
15*b5470b48Suwe  .text (KERNEL_BASE_virt + ALIGN(SIZEOF(.start), ALIGNOF(.text))) :
16*b5470b48Suwe  AT (LOADADDR(.start) + ALIGN(SIZEOF(.start), ALIGNOF(.text)))
17bfca87bbSthorpej  {
18bfca87bbSthorpej    *(.text)
19bfca87bbSthorpej    *(.text.*)
20bfca87bbSthorpej    *(.stub)
21bfca87bbSthorpej    *(.glue_7t) *(.glue_7)
22db473b34Suebayasi  }
23a9554742Suwe
24a9554742Suwe  PROVIDE(__rodata_start = .);
25a9554742Suwe  .rodata :
26a9554742Suwe  {
27a9554742Suwe    *(.rodata)
28a9554742Suwe    *(.rodata.*)
29a9554742Suwe    . = ALIGN(64);
30a9554742Suwe    __CTOR_LIST__ = .;
31a9554742Suwe    *(.ctors)
32a9554742Suwe    *(.init_array)
33a9554742Suwe    __CTOR_END__ = .;
34a9554742Suwe  }
35a9554742Suwe
36bfca87bbSthorpej  PROVIDE (__etext = .);
37bfca87bbSthorpej  PROVIDE (_etext = .);
38bfca87bbSthorpej  PROVIDE (etext = .);
39a9554742Suwe
40a9554742Suwe  /* Adjust the address for the data segment to start on the next large page
41bfca87bbSthorpej     boundary.  */
42a9554742Suwe  . = ALIGN(0x10000);
43bfca87bbSthorpej  .data    :
44bfca87bbSthorpej  {
45bfca87bbSthorpej    __data_start = . ;
46bfca87bbSthorpej    *(.data)
47bfca87bbSthorpej    *(.data.*)
48bfca87bbSthorpej  }
49bfca87bbSthorpej  .sdata     :
50bfca87bbSthorpej  {
51bfca87bbSthorpej    *(.sdata)
52bfca87bbSthorpej    *(.sdata.*)
53bfca87bbSthorpej  }
54a9554742Suwe  . = ALIGN(8);
55bfca87bbSthorpej  _edata = .;
56bfca87bbSthorpej  PROVIDE (edata = .);
57bfca87bbSthorpej  __bss_start = .;
58bfca87bbSthorpej  __bss_start__ = .;
59bfca87bbSthorpej  .sbss      :
60bfca87bbSthorpej  {
61bfca87bbSthorpej    PROVIDE (__sbss_start = .);
62bfca87bbSthorpej    PROVIDE (___sbss_start = .);
63bfca87bbSthorpej    *(.dynsbss)
64bfca87bbSthorpej    *(.sbss)
65bfca87bbSthorpej    *(.sbss.*)
66bfca87bbSthorpej    *(.scommon)
67bfca87bbSthorpej    PROVIDE (__sbss_end = .);
68bfca87bbSthorpej    PROVIDE (___sbss_end = .);
69bfca87bbSthorpej  }
70bfca87bbSthorpej  .bss       :
71bfca87bbSthorpej  {
72bfca87bbSthorpej    *(.dynbss)
73bfca87bbSthorpej    *(.bss)
74bfca87bbSthorpej    *(.bss.*)
75bfca87bbSthorpej    *(COMMON)
76bfca87bbSthorpej    /* Align here to ensure that the .bss section occupies space up to
77bfca87bbSthorpej       _end.  Align after .bss to ensure correct alignment even if the
78bfca87bbSthorpej       .bss section disappears because there are no input sections.  */
79bfca87bbSthorpej    . = ALIGN(32 / 8);
80bfca87bbSthorpej  }
81bfca87bbSthorpej  . = ALIGN(32 / 8);
82bfca87bbSthorpej  _end = .;
83bfca87bbSthorpej  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
84bfca87bbSthorpej  PROVIDE (end = .);
85bfca87bbSthorpej}
86