11.12Suwe/*	$NetBSD: kern.ldscript,v 1.12 2023/12/27 19:58:22 uwe Exp $	*/
21.1Sthorpej
31.1SthorpejSECTIONS
41.1Sthorpej{
51.11Suwe  KERNEL_BASE_phys = 0x00010000;
61.11Suwe  KERNEL_BASE_virt = 0xf0010000;
71.11Suwe
81.1Sthorpej  /* Kernel start: */
91.11Suwe  .start (KERNEL_BASE_phys) :
101.1Sthorpej  {
111.1Sthorpej    *(.start)
121.7Suebayasi  }
131.1Sthorpej
141.1Sthorpej  /* Read-only sections, merged into text segment: */
151.12Suwe  .text (KERNEL_BASE_virt + ALIGN(SIZEOF(.start), ALIGNOF(.text))) :
161.12Suwe  AT (LOADADDR(.start) + ALIGN(SIZEOF(.start), ALIGNOF(.text)))
171.1Sthorpej  {
181.1Sthorpej    *(.text)
191.1Sthorpej    *(.text.*)
201.1Sthorpej    *(.stub)
211.1Sthorpej    *(.glue_7t) *(.glue_7)
221.7Suebayasi  }
231.11Suwe
241.11Suwe  PROVIDE(__rodata_start = .);
251.11Suwe  .rodata :
261.11Suwe  {
271.11Suwe    *(.rodata)
281.11Suwe    *(.rodata.*)
291.11Suwe    . = ALIGN(64);
301.11Suwe    __CTOR_LIST__ = .;
311.11Suwe    *(.ctors)
321.11Suwe    *(.init_array)
331.11Suwe    __CTOR_END__ = .;
341.11Suwe  }
351.11Suwe
361.1Sthorpej  PROVIDE (__etext = .);
371.1Sthorpej  PROVIDE (_etext = .);
381.1Sthorpej  PROVIDE (etext = .);
391.11Suwe
401.11Suwe  /* Adjust the address for the data segment to start on the next large page
411.1Sthorpej     boundary.  */
421.11Suwe  . = ALIGN(0x10000);
431.1Sthorpej  .data    :
441.1Sthorpej  {
451.1Sthorpej    __data_start = . ;
461.1Sthorpej    *(.data)
471.1Sthorpej    *(.data.*)
481.1Sthorpej  }
491.3Suwe  .sdata     :
501.1Sthorpej  {
511.5Suebayasi    *(.sdata)
521.1Sthorpej    *(.sdata.*)
531.1Sthorpej  }
541.11Suwe  . = ALIGN(8);
551.1Sthorpej  _edata = .;
561.1Sthorpej  PROVIDE (edata = .);
571.1Sthorpej  __bss_start = .;
581.1Sthorpej  __bss_start__ = .;
591.1Sthorpej  .sbss      :
601.1Sthorpej  {
611.1Sthorpej    PROVIDE (__sbss_start = .);
621.1Sthorpej    PROVIDE (___sbss_start = .);
631.1Sthorpej    *(.dynsbss)
641.1Sthorpej    *(.sbss)
651.1Sthorpej    *(.sbss.*)
661.1Sthorpej    *(.scommon)
671.1Sthorpej    PROVIDE (__sbss_end = .);
681.1Sthorpej    PROVIDE (___sbss_end = .);
691.1Sthorpej  }
701.1Sthorpej  .bss       :
711.1Sthorpej  {
721.6Suebayasi    *(.dynbss)
731.6Suebayasi    *(.bss)
741.6Suebayasi    *(.bss.*)
751.6Suebayasi    *(COMMON)
761.6Suebayasi    /* Align here to ensure that the .bss section occupies space up to
771.6Suebayasi       _end.  Align after .bss to ensure correct alignment even if the
781.6Suebayasi       .bss section disappears because there are no input sections.  */
791.6Suebayasi    . = ALIGN(32 / 8);
801.1Sthorpej  }
811.1Sthorpej  . = ALIGN(32 / 8);
821.1Sthorpej  _end = .;
831.1Sthorpej  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
841.1Sthorpej  PROVIDE (end = .);
851.1Sthorpej}
86