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