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