kern.ldscript revision 1.1
11.1Sthorpej/* $NetBSD: kern.ldscript,v 1.1 2001/01/20 01:05:23 thorpej Exp $ */ 21.1Sthorpej 31.1Sthorpej/* 41.1Sthorpej * Kernel linker script for NetBSD/i386. This script is based on 51.1Sthorpej * elf_i386.x, but puts _etext after all of the read-only sections. 61.1Sthorpej */ 71.1Sthorpej 81.1SthorpejOUTPUT_FORMAT("elf32-i386", "elf32-i386", 91.1Sthorpej "elf32-i386") 101.1SthorpejOUTPUT_ARCH(i386) 111.1SthorpejENTRY(_start) 121.1SthorpejSEARCH_DIR(/usr/lib); 131.1Sthorpej/* Do we need any of these for elf? 141.1Sthorpej __DYNAMIC = 0; */ 151.1SthorpejSECTIONS 161.1Sthorpej{ 171.1Sthorpej /* Read-only sections, merged into text segment: */ 181.1Sthorpej . = 0x08048000 + SIZEOF_HEADERS; 191.1Sthorpej .interp : { *(.interp) } 201.1Sthorpej .hash : { *(.hash) } 211.1Sthorpej .dynsym : { *(.dynsym) } 221.1Sthorpej .dynstr : { *(.dynstr) } 231.1Sthorpej .gnu.version : { *(.gnu.version) } 241.1Sthorpej .gnu.version_d : { *(.gnu.version_d) } 251.1Sthorpej .gnu.version_r : { *(.gnu.version_r) } 261.1Sthorpej .rel.text : 271.1Sthorpej { *(.rel.text) *(.rel.gnu.linkonce.t*) } 281.1Sthorpej .rela.text : 291.1Sthorpej { *(.rela.text) *(.rela.gnu.linkonce.t*) } 301.1Sthorpej .rel.data : 311.1Sthorpej { *(.rel.data) *(.rel.gnu.linkonce.d*) } 321.1Sthorpej .rela.data : 331.1Sthorpej { *(.rela.data) *(.rela.gnu.linkonce.d*) } 341.1Sthorpej .rel.rodata : 351.1Sthorpej { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } 361.1Sthorpej .rela.rodata : 371.1Sthorpej { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } 381.1Sthorpej .rel.got : { *(.rel.got) } 391.1Sthorpej .rela.got : { *(.rela.got) } 401.1Sthorpej .rel.ctors : { *(.rel.ctors) } 411.1Sthorpej .rela.ctors : { *(.rela.ctors) } 421.1Sthorpej .rel.dtors : { *(.rel.dtors) } 431.1Sthorpej .rela.dtors : { *(.rela.dtors) } 441.1Sthorpej .rel.init : { *(.rel.init) } 451.1Sthorpej .rela.init : { *(.rela.init) } 461.1Sthorpej .rel.fini : { *(.rel.fini) } 471.1Sthorpej .rela.fini : { *(.rela.fini) } 481.1Sthorpej .rel.bss : { *(.rel.bss) } 491.1Sthorpej .rela.bss : { *(.rela.bss) } 501.1Sthorpej .rel.plt : { *(.rel.plt) } 511.1Sthorpej .rela.plt : { *(.rela.plt) } 521.1Sthorpej .init : { *(.init) } =0x9090 531.1Sthorpej .plt : { *(.plt) } 541.1Sthorpej .text : 551.1Sthorpej { 561.1Sthorpej *(.text) 571.1Sthorpej *(.stub) 581.1Sthorpej /* .gnu.warning sections are handled specially by elf32.em. */ 591.1Sthorpej *(.gnu.warning) 601.1Sthorpej *(.gnu.linkonce.t*) 611.1Sthorpej } =0x9090 621.1Sthorpej .fini : { *(.fini) } =0x9090 631.1Sthorpej .rodata : { *(.rodata) *(.gnu.linkonce.r*) } 641.1Sthorpej .rodata1 : { *(.rodata1) } 651.1Sthorpej _etext = .; 661.1Sthorpej PROVIDE (etext = .); 671.1Sthorpej /* Adjust the address for the data segment. We want to adjust up to 681.1Sthorpej the same address within the page on the next page up. */ 691.1Sthorpej . = ALIGN(0x1000) + (. & (0x1000 - 1)); 701.1Sthorpej .data : 711.1Sthorpej { 721.1Sthorpej *(.data) 731.1Sthorpej *(.gnu.linkonce.d*) 741.1Sthorpej CONSTRUCTORS 751.1Sthorpej } 761.1Sthorpej .data1 : { *(.data1) } 771.1Sthorpej .ctors : 781.1Sthorpej { 791.1Sthorpej *(.ctors) 801.1Sthorpej } 811.1Sthorpej .dtors : 821.1Sthorpej { 831.1Sthorpej *(.dtors) 841.1Sthorpej } 851.1Sthorpej .got : { *(.got.plt) *(.got) } 861.1Sthorpej .dynamic : { *(.dynamic) } 871.1Sthorpej /* We want the small data sections together, so single-instruction offsets 881.1Sthorpej can access them all, and initialized data all before uninitialized, so 891.1Sthorpej we can shorten the on-disk segment size. */ 901.1Sthorpej .sdata : { *(.sdata) } 911.1Sthorpej _edata = .; 921.1Sthorpej PROVIDE (edata = .); 931.1Sthorpej __bss_start = .; 941.1Sthorpej .sbss : { *(.sbss) *(.scommon) } 951.1Sthorpej .bss : 961.1Sthorpej { 971.1Sthorpej *(.dynbss) 981.1Sthorpej *(.bss) 991.1Sthorpej *(COMMON) 1001.1Sthorpej } 1011.1Sthorpej . = ALIGN(32 / 8); 1021.1Sthorpej _end = . ; 1031.1Sthorpej PROVIDE (end = .); 1041.1Sthorpej /* Stabs debugging sections. */ 1051.1Sthorpej .stab 0 : { *(.stab) } 1061.1Sthorpej .stabstr 0 : { *(.stabstr) } 1071.1Sthorpej .stab.excl 0 : { *(.stab.excl) } 1081.1Sthorpej .stab.exclstr 0 : { *(.stab.exclstr) } 1091.1Sthorpej .stab.index 0 : { *(.stab.index) } 1101.1Sthorpej .stab.indexstr 0 : { *(.stab.indexstr) } 1111.1Sthorpej .comment 0 : { *(.comment) } 1121.1Sthorpej /* DWARF debug sections. 1131.1Sthorpej Symbols in the DWARF debugging sections are relative to the beginning 1141.1Sthorpej of the section so we begin them at 0. */ 1151.1Sthorpej /* DWARF 1 */ 1161.1Sthorpej .debug 0 : { *(.debug) } 1171.1Sthorpej .line 0 : { *(.line) } 1181.1Sthorpej /* GNU DWARF 1 extensions */ 1191.1Sthorpej .debug_srcinfo 0 : { *(.debug_srcinfo) } 1201.1Sthorpej .debug_sfnames 0 : { *(.debug_sfnames) } 1211.1Sthorpej /* DWARF 1.1 and DWARF 2 */ 1221.1Sthorpej .debug_aranges 0 : { *(.debug_aranges) } 1231.1Sthorpej .debug_pubnames 0 : { *(.debug_pubnames) } 1241.1Sthorpej /* DWARF 2 */ 1251.1Sthorpej .debug_info 0 : { *(.debug_info) } 1261.1Sthorpej .debug_abbrev 0 : { *(.debug_abbrev) } 1271.1Sthorpej .debug_line 0 : { *(.debug_line) } 1281.1Sthorpej .debug_frame 0 : { *(.debug_frame) } 1291.1Sthorpej .debug_str 0 : { *(.debug_str) } 1301.1Sthorpej .debug_loc 0 : { *(.debug_loc) } 1311.1Sthorpej .debug_macinfo 0 : { *(.debug_macinfo) } 1321.1Sthorpej /* SGI/MIPS DWARF 2 extensions */ 1331.1Sthorpej .debug_weaknames 0 : { *(.debug_weaknames) } 1341.1Sthorpej .debug_funcnames 0 : { *(.debug_funcnames) } 1351.1Sthorpej .debug_typenames 0 : { *(.debug_typenames) } 1361.1Sthorpej .debug_varnames 0 : { *(.debug_varnames) } 1371.1Sthorpej /* These must appear regardless of . */ 1381.1Sthorpej} 139