kern.ldscript revision 1.12
11.3Sperry/*	$NetBSD: kern.ldscript,v 1.12 2015/08/25 02:58:59 uebayasi Exp $	*/
21.2Sthorpej
31.1Sthorpej#undef sparc
41.1Sthorpej
51.1Sthorpej/*
61.1Sthorpej * Kernel linker script for NetBSD/sparc.  This script is based on
71.1Sthorpej * elf32_sparc.xn, but puts _etext after all of the read-only sections.
81.1Sthorpej */
91.1Sthorpej
101.1SthorpejOUTPUT_FORMAT("elf32-sparc", "elf32-sparc",
111.1Sthorpej	      "elf32-sparc")
121.1SthorpejOUTPUT_ARCH(sparc)
131.1SthorpejENTRY(_start)
141.1Sthorpej/* Do we need any of these for elf?
151.1Sthorpej   __DYNAMIC = 0;    */
161.1SthorpejSECTIONS
171.1Sthorpej{
181.3Sperry  /* Read-only sections, merged into text segment: */
191.3Sperry  . = 0x10000 + SIZEOF_HEADERS;
201.3Sperry  .text      :
211.3Sperry  {
221.1Sthorpej    *(.text)
231.1Sthorpej    *(.stub)
241.1Sthorpej    /* .gnu.warning sections are handled specially by elf32.em.  */
251.1Sthorpej    *(.gnu.warning)
261.1Sthorpej    *(.gnu.linkonce.t*)
271.1Sthorpej  } =0
281.1Sthorpej  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
291.1Sthorpej  .rodata1   : { *(.rodata1) }
301.1Sthorpej  _etext = .;
311.1Sthorpej  PROVIDE (etext = .);
321.1Sthorpej  /* Adjust the address for the data segment.  We want to adjust up to
331.1Sthorpej     the same address within the page on the next page up.  */
341.1Sthorpej  . = ALIGN(0x10000) + (. & (0x10000 - 1));
351.1Sthorpej  kernel_data_start = .;
361.1Sthorpej  .data    :
371.1Sthorpej  {
381.1Sthorpej    *(.data)
391.1Sthorpej    *(.gnu.linkonce.d*)
401.1Sthorpej    CONSTRUCTORS
411.1Sthorpej  }
421.1Sthorpej  .data1   : { *(.data1) }
431.1Sthorpej  .plt      : { *(.plt)	}
441.1Sthorpej  .got           : { *(.got.plt) *(.got) }
451.1Sthorpej  .dynamic       : { *(.dynamic) }
461.1Sthorpej  /* We want the small data sections together, so single-instruction offsets
471.1Sthorpej     can access them all, and initialized data all before uninitialized, so
481.1Sthorpej     we can shorten the on-disk segment size.  */
491.1Sthorpej  .sdata     : { *(.sdata) }
501.1Sthorpej  _edata  =  .;
511.1Sthorpej  PROVIDE (edata = .);
52  __bss_start = .;
53  .sbss      : { *(.sbss) *(.scommon) }
54  .bss       :
55  {
56    *(.dynbss)
57    *(.bss)
58    *(COMMON)
59  }
60  . = ALIGN(32 / 8);
61  _end = . ;
62  PROVIDE (end = .);
63}
64