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