xref: /netbsd-src/sys/arch/sparc64/conf/kern32.ldscript (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1/*	$NetBSD: kern32.ldscript,v 1.17 2016/03/25 14:58:53 nakayama Exp $	*/
2
3#undef sparc
4
5/*
6 * Kernel linker script for NetBSD/sparc.  This script is based on
7 * elf32_sparc.xn, but puts _etext after all of the read-only sections.
8 */
9
10OUTPUT_FORMAT("elf32-sparc", "elf32-sparc",
11	      "elf32-sparc")
12OUTPUT_ARCH(sparc)
13ENTRY(_start)
14/* Do we need any of these for elf?
15   __DYNAMIC = 0;    */
16SECTIONS
17{
18  /* Read-only sections, merged into text segment: */
19  . = 0x10000 + SIZEOF_HEADERS;
20  .text      :
21  {
22    *(.text)
23    *(.stub)
24    /* .gnu.warning sections are handled specially by elf32.em.  */
25    *(.gnu.warning)
26    *(.gnu.linkonce.t*)
27  } =0
28  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
29  .rodata1   : { *(.rodata1) }
30  _etext = .;
31  PROVIDE (etext = .);
32  /* Adjust the address for the data segment.  We push the data segment
33     up to the next 4MB boundary so that we can map the text with large
34     pages. */
35  . = ALIGN(0x400000);
36  kernel_data_start = .;
37  .data    :
38  {
39    *(.data)
40    *(.gnu.linkonce.d*)
41    CONSTRUCTORS
42  }
43  .data1   : { *(.data1) }
44  . = ALIGN(64);	/* COHERENCY_UNIT */
45  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
46  . = ALIGN(64);	/* COHERENCY_UNIT */
47  .data.read_mostly : { *(.data.read_mostly) }
48  . = ALIGN(64);	/* COHERENCY_UNIT */
49  .plt      : { *(.plt)	}
50  .got           : { *(.got.plt) *(.got) }
51  .dynamic       : { *(.dynamic) }
52  /* We want the small data sections together, so single-instruction offsets
53     can access them all, and initialized data all before uninitialized, so
54     we can shorten the on-disk segment size.  */
55  .sdata     : { *(.sdata) }
56  _edata  =  .;
57  PROVIDE (edata = .);
58  __bss_start = .;
59  .sbss      : { *(.sbss) *(.scommon) }
60  .bss       :
61  {
62    *(.dynbss)
63    *(.bss)
64    *(COMMON)
65  }
66  . = ALIGN(32 / 8);
67  _end = . ;
68  PROVIDE (end = .);
69  .note.netbsd.ident :
70  {
71    KEEP(*(.note.netbsd.ident));
72  }
73}
74