kern.ldscript revision 1.11
1/*	$NetBSD: kern.ldscript,v 1.11 2015/08/24 08:13:07 uebayasi Exp $	*/
2
3/*
4 * Kernel linker script for NetBSD/sparc.  This script is based on
5 * elf32_sparc.xn, but puts _etext after all of the read-only sections.
6 */
7
8OUTPUT_FORMAT("elf32-sparc", "elf32-sparc",
9	      "elf32-sparc")
10OUTPUT_ARCH(sparc)
11ENTRY(_start)
12/* Do we need any of these for elf?
13   __DYNAMIC = 0;    */
14SECTIONS
15{
16  /* Read-only sections, merged into text segment: */
17  . = 0x10000 + SIZEOF_HEADERS;
18  .text      :
19  {
20    *(.text)
21    *(.stub)
22    /* .gnu.warning sections are handled specially by elf32.em.  */
23    *(.gnu.warning)
24    *(.gnu.linkonce.t*)
25  } =0
26  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
27  .rodata1   : { *(.rodata1) }
28  _etext = .;
29  PROVIDE (etext = .);
30  /* Adjust the address for the data segment.  We want to adjust up to
31     the same address within the page on the next page up.  */
32  . = ALIGN(0x10000) + (. & (0x10000 - 1));
33  kernel_data_start = .;
34  .data    :
35  {
36    *(.data)
37    *(.gnu.linkonce.d*)
38    CONSTRUCTORS
39  }
40  .data1   : { *(.data1) }
41  .plt      : { *(.plt)	}
42  .got           : { *(.got.plt) *(.got) }
43  .dynamic       : { *(.dynamic) }
44  /* We want the small data sections together, so single-instruction offsets
45     can access them all, and initialized data all before uninitialized, so
46     we can shorten the on-disk segment size.  */
47  .sdata     : { *(.sdata) }
48  _edata  =  .;
49  PROVIDE (edata = .);
50  __bss_start = .;
51  .sbss      : { *(.sbss) *(.scommon) }
52  .bss       :
53  {
54    *(.dynbss)
55    *(.bss)
56    *(COMMON)
57  }
58  . = ALIGN(32 / 8);
59  _end = . ;
60  PROVIDE (end = .);
61}
62