kern.ldscript revision 1.10
1/*	$NetBSD: kern.ldscript,v 1.10 2015/08/22 23:51:48 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  /* Stabs debugging sections.  */
62  .stab 0 : { *(.stab) }
63  .stabstr 0 : { *(.stabstr) }
64  .stab.excl 0 : { *(.stab.excl) }
65  .stab.exclstr 0 : { *(.stab.exclstr) }
66  .stab.index 0 : { *(.stab.index) }
67  .stab.indexstr 0 : { *(.stab.indexstr) }
68  .comment 0 : { *(.comment) }
69  /* DWARF debug sections.
70     Symbols in the DWARF debugging sections are relative to the beginning
71     of the section so we begin them at 0.  */
72  /* DWARF 1 */
73  .debug          0 : { *(.debug) }
74  .line           0 : { *(.line) }
75  /* GNU DWARF 1 extensions */
76  .debug_srcinfo  0 : { *(.debug_srcinfo) }
77  .debug_sfnames  0 : { *(.debug_sfnames) }
78  /* DWARF 1.1 and DWARF 2 */
79  .debug_aranges  0 : { *(.debug_aranges) }
80  .debug_pubnames 0 : { *(.debug_pubnames) }
81  /* DWARF 2 */
82  .debug_info     0 : { *(.debug_info) }
83  .debug_abbrev   0 : { *(.debug_abbrev) }
84  .debug_line     0 : { *(.debug_line) }
85  .debug_frame    0 : { *(.debug_frame) }
86  .debug_str      0 : { *(.debug_str) }
87  .debug_loc      0 : { *(.debug_loc) }
88  .debug_macinfo  0 : { *(.debug_macinfo) }
89  /* SGI/MIPS DWARF 2 extensions */
90  .debug_weaknames 0 : { *(.debug_weaknames) }
91  .debug_funcnames 0 : { *(.debug_funcnames) }
92  .debug_typenames 0 : { *(.debug_typenames) }
93  .debug_varnames  0 : { *(.debug_varnames) }
94  /* These must appear regardless of  .  */
95}
96