kern32.ldscript revision 1.13
1/*	$NetBSD: kern32.ldscript,v 1.13 2015/08/22 23:47:34 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  .interp     : { *(.interp) 	}
19  .hash          : { *(.hash)		}
20  .dynsym        : { *(.dynsym)		}
21  .dynstr        : { *(.dynstr)		}
22  .gnu.version   : { *(.gnu.version)	}
23  .gnu.version_d   : { *(.gnu.version_d)	}
24  .gnu.version_r   : { *(.gnu.version_r)	}
25  .rel.text      :
26    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
27  .rela.text     :
28    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
29  .rel.data      :
30    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
31  .rela.data     :
32    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
33  .rel.rodata    :
34    { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
35  .rela.rodata   :
36    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
37  .rel.got       : { *(.rel.got)		}
38  .rela.got      : { *(.rela.got)		}
39  .rel.bss       : { *(.rel.bss)		}
40  .rela.bss      : { *(.rela.bss)		}
41  .rel.plt       : { *(.rel.plt)		}
42  .rela.plt      : { *(.rela.plt)		}
43  .text      :
44  {
45    *(.text)
46    *(.stub)
47    /* .gnu.warning sections are handled specially by elf32.em.  */
48    *(.gnu.warning)
49    *(.gnu.linkonce.t*)
50  } =0
51  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
52  .rodata1   : { *(.rodata1) }
53  _etext = .;
54  PROVIDE (etext = .);
55  /* Adjust the address for the data segment.  We push the data segment
56     up to the next 4MB boundary so that we can map the text with large
57     pages. */
58  . = ALIGN(0x400000);
59  kernel_data_start = .;
60  .data    :
61  {
62    *(.data)
63    *(.gnu.linkonce.d*)
64    CONSTRUCTORS
65  }
66  .data1   : { *(.data1) }
67  . = ALIGN(64);	/* COHERENCY_UNIT */
68  .data.cacheline_aligned : { *(.data_cacheline_aligned) }
69  . = ALIGN(64);	/* COHERENCY_UNIT */
70  .data.read_mostly : { *(.data.read_mostly) }
71  . = ALIGN(64);	/* COHERENCY_UNIT */
72  .plt      : { *(.plt)	}
73  .got           : { *(.got.plt) *(.got) }
74  .dynamic       : { *(.dynamic) }
75  /* We want the small data sections together, so single-instruction offsets
76     can access them all, and initialized data all before uninitialized, so
77     we can shorten the on-disk segment size.  */
78  .sdata     : { *(.sdata) }
79  _edata  =  .;
80  PROVIDE (edata = .);
81  __bss_start = .;
82  .sbss      : { *(.sbss) *(.scommon) }
83  .bss       :
84  {
85    *(.dynbss)
86    *(.bss)
87    *(COMMON)
88  }
89  . = ALIGN(32 / 8);
90  _end = . ;
91  PROVIDE (end = .);
92  /* Stabs debugging sections.  */
93  .stab 0 : { *(.stab) }
94  .stabstr 0 : { *(.stabstr) }
95  .stab.excl 0 : { *(.stab.excl) }
96  .stab.exclstr 0 : { *(.stab.exclstr) }
97  .stab.index 0 : { *(.stab.index) }
98  .stab.indexstr 0 : { *(.stab.indexstr) }
99  .comment 0 : { *(.comment) }
100  /* DWARF debug sections.
101     Symbols in the DWARF debugging sections are relative to the beginning
102     of the section so we begin them at 0.  */
103  /* DWARF 1 */
104  .debug          0 : { *(.debug) }
105  .line           0 : { *(.line) }
106  /* GNU DWARF 1 extensions */
107  .debug_srcinfo  0 : { *(.debug_srcinfo) }
108  .debug_sfnames  0 : { *(.debug_sfnames) }
109  /* DWARF 1.1 and DWARF 2 */
110  .debug_aranges  0 : { *(.debug_aranges) }
111  .debug_pubnames 0 : { *(.debug_pubnames) }
112  /* DWARF 2 */
113  .debug_info     0 : { *(.debug_info) }
114  .debug_abbrev   0 : { *(.debug_abbrev) }
115  .debug_line     0 : { *(.debug_line) }
116  .debug_frame    0 : { *(.debug_frame) }
117  .debug_str      0 : { *(.debug_str) }
118  .debug_loc      0 : { *(.debug_loc) }
119  .debug_macinfo  0 : { *(.debug_macinfo) }
120  /* SGI/MIPS DWARF 2 extensions */
121  .debug_weaknames 0 : { *(.debug_weaknames) }
122  .debug_funcnames 0 : { *(.debug_funcnames) }
123  .debug_typenames 0 : { *(.debug_typenames) }
124  .debug_varnames  0 : { *(.debug_varnames) }
125  /* These must appear regardless of  .  */
126  .note.netbsd.ident :
127  {
128    KEEP(*(.note.netbsd.ident));
129  }
130}
131