kern32.ldscript revision 1.14
1/*	$NetBSD: kern32.ldscript,v 1.14 2015/08/22 23:49:54 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 push the data segment
31     up to the next 4MB boundary so that we can map the text with large
32     pages. */
33  . = ALIGN(0x400000);
34  kernel_data_start = .;
35  .data    :
36  {
37    *(.data)
38    *(.gnu.linkonce.d*)
39    CONSTRUCTORS
40  }
41  .data1   : { *(.data1) }
42  . = ALIGN(64);	/* COHERENCY_UNIT */
43  .data.cacheline_aligned : { *(.data_cacheline_aligned) }
44  . = ALIGN(64);	/* COHERENCY_UNIT */
45  .data.read_mostly : { *(.data.read_mostly) }
46  . = ALIGN(64);	/* COHERENCY_UNIT */
47  .plt      : { *(.plt)	}
48  .got           : { *(.got.plt) *(.got) }
49  .dynamic       : { *(.dynamic) }
50  /* We want the small data sections together, so single-instruction offsets
51     can access them all, and initialized data all before uninitialized, so
52     we can shorten the on-disk segment size.  */
53  .sdata     : { *(.sdata) }
54  _edata  =  .;
55  PROVIDE (edata = .);
56  __bss_start = .;
57  .sbss      : { *(.sbss) *(.scommon) }
58  .bss       :
59  {
60    *(.dynbss)
61    *(.bss)
62    *(COMMON)
63  }
64  . = ALIGN(32 / 8);
65  _end = . ;
66  PROVIDE (end = .);
67  /* Stabs debugging sections.  */
68  .stab 0 : { *(.stab) }
69  .stabstr 0 : { *(.stabstr) }
70  .stab.excl 0 : { *(.stab.excl) }
71  .stab.exclstr 0 : { *(.stab.exclstr) }
72  .stab.index 0 : { *(.stab.index) }
73  .stab.indexstr 0 : { *(.stab.indexstr) }
74  .comment 0 : { *(.comment) }
75  /* DWARF debug sections.
76     Symbols in the DWARF debugging sections are relative to the beginning
77     of the section so we begin them at 0.  */
78  /* DWARF 1 */
79  .debug          0 : { *(.debug) }
80  .line           0 : { *(.line) }
81  /* GNU DWARF 1 extensions */
82  .debug_srcinfo  0 : { *(.debug_srcinfo) }
83  .debug_sfnames  0 : { *(.debug_sfnames) }
84  /* DWARF 1.1 and DWARF 2 */
85  .debug_aranges  0 : { *(.debug_aranges) }
86  .debug_pubnames 0 : { *(.debug_pubnames) }
87  /* DWARF 2 */
88  .debug_info     0 : { *(.debug_info) }
89  .debug_abbrev   0 : { *(.debug_abbrev) }
90  .debug_line     0 : { *(.debug_line) }
91  .debug_frame    0 : { *(.debug_frame) }
92  .debug_str      0 : { *(.debug_str) }
93  .debug_loc      0 : { *(.debug_loc) }
94  .debug_macinfo  0 : { *(.debug_macinfo) }
95  /* SGI/MIPS DWARF 2 extensions */
96  .debug_weaknames 0 : { *(.debug_weaknames) }
97  .debug_funcnames 0 : { *(.debug_funcnames) }
98  .debug_typenames 0 : { *(.debug_typenames) }
99  .debug_varnames  0 : { *(.debug_varnames) }
100  /* These must appear regardless of  .  */
101  .note.netbsd.ident :
102  {
103    KEEP(*(.note.netbsd.ident));
104  }
105}
106