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