kern32.ldscript revision 1.11
11.11Suebayasi/* $NetBSD: kern32.ldscript,v 1.11 2015/08/20 07:00:49 uebayasi Exp $ */ 21.1Smrg 31.1Smrg/* 41.1Smrg * Kernel linker script for NetBSD/sparc. This script is based on 51.1Smrg * elf32_sparc.xn, but puts _etext after all of the read-only sections. 61.1Smrg */ 71.1Smrg 81.1SmrgOUTPUT_FORMAT("elf32-sparc", "elf32-sparc", 91.1Smrg "elf32-sparc") 101.1SmrgOUTPUT_ARCH(sparc) 111.1SmrgENTRY(_start) 121.1SmrgSEARCH_DIR(/usr/lib); 131.1Smrg/* Do we need any of these for elf? 141.1Smrg __DYNAMIC = 0; */ 151.1SmrgSECTIONS 161.1Smrg{ 171.1Smrg /* Read-only sections, merged into text segment: */ 181.5Smartin . = 0x10000 + SIZEOF_HEADERS; 191.1Smrg .interp : { *(.interp) } 201.1Smrg .hash : { *(.hash) } 211.1Smrg .dynsym : { *(.dynsym) } 221.1Smrg .dynstr : { *(.dynstr) } 231.1Smrg .gnu.version : { *(.gnu.version) } 241.1Smrg .gnu.version_d : { *(.gnu.version_d) } 251.1Smrg .gnu.version_r : { *(.gnu.version_r) } 261.1Smrg .rel.text : 271.1Smrg { *(.rel.text) *(.rel.gnu.linkonce.t*) } 281.1Smrg .rela.text : 291.1Smrg { *(.rela.text) *(.rela.gnu.linkonce.t*) } 301.1Smrg .rel.data : 311.1Smrg { *(.rel.data) *(.rel.gnu.linkonce.d*) } 321.1Smrg .rela.data : 331.1Smrg { *(.rela.data) *(.rela.gnu.linkonce.d*) } 341.1Smrg .rel.rodata : 351.1Smrg { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } 361.1Smrg .rela.rodata : 371.1Smrg { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } 381.1Smrg .rel.got : { *(.rel.got) } 391.1Smrg .rela.got : { *(.rela.got) } 401.1Smrg .rel.ctors : { *(.rel.ctors) } 411.1Smrg .rela.ctors : { *(.rela.ctors) } 421.1Smrg .rel.dtors : { *(.rel.dtors) } 431.1Smrg .rela.dtors : { *(.rela.dtors) } 441.1Smrg .rel.init : { *(.rel.init) } 451.1Smrg .rela.init : { *(.rela.init) } 461.1Smrg .rel.fini : { *(.rel.fini) } 471.1Smrg .rela.fini : { *(.rela.fini) } 481.1Smrg .rel.bss : { *(.rel.bss) } 491.1Smrg .rela.bss : { *(.rela.bss) } 501.1Smrg .rel.plt : { *(.rel.plt) } 511.1Smrg .rela.plt : { *(.rela.plt) } 521.1Smrg .init : { *(.init) } =0 531.1Smrg .text : 541.1Smrg { 551.1Smrg *(.text) 561.1Smrg *(.stub) 571.1Smrg /* .gnu.warning sections are handled specially by elf32.em. */ 581.1Smrg *(.gnu.warning) 591.1Smrg *(.gnu.linkonce.t*) 601.1Smrg } =0 611.1Smrg .fini : { *(.fini) } =0 621.1Smrg .rodata : { *(.rodata) *(.gnu.linkonce.r*) } 631.1Smrg .rodata1 : { *(.rodata1) } 641.1Smrg _etext = .; 651.1Smrg PROVIDE (etext = .); 661.8Schs /* Adjust the address for the data segment. We push the data segment 671.8Schs up to the next 4MB boundary so that we can map the text with large 681.8Schs pages. */ 691.8Schs . = ALIGN(0x400000); 701.1Smrg kernel_data_start = .; 711.1Smrg .data : 721.1Smrg { 731.1Smrg *(.data) 741.1Smrg *(.gnu.linkonce.d*) 751.1Smrg CONSTRUCTORS 761.1Smrg } 771.1Smrg .data1 : { *(.data1) } 781.10Smjf . = ALIGN(64); /* COHERENCY_UNIT */ 791.10Smjf .data.cacheline_aligned : { *(.data_cacheline_aligned) } 801.10Smjf . = ALIGN(64); /* COHERENCY_UNIT */ 811.10Smjf .data.read_mostly : { *(.data.read_mostly) } 821.10Smjf . = ALIGN(64); /* COHERENCY_UNIT */ 831.1Smrg .ctors : 841.1Smrg { 851.1Smrg *(.ctors) 861.1Smrg } 871.1Smrg .dtors : 881.1Smrg { 891.1Smrg *(.dtors) 901.1Smrg } 911.1Smrg .plt : { *(.plt) } 921.1Smrg .got : { *(.got.plt) *(.got) } 931.1Smrg .dynamic : { *(.dynamic) } 941.1Smrg /* We want the small data sections together, so single-instruction offsets 951.1Smrg can access them all, and initialized data all before uninitialized, so 961.1Smrg we can shorten the on-disk segment size. */ 971.1Smrg .sdata : { *(.sdata) } 981.1Smrg _edata = .; 991.1Smrg PROVIDE (edata = .); 1001.1Smrg __bss_start = .; 1011.1Smrg .sbss : { *(.sbss) *(.scommon) } 1021.1Smrg .bss : 1031.1Smrg { 1041.11Suebayasi *(.dynbss) 1051.11Suebayasi *(.bss) 1061.11Suebayasi *(COMMON) 1071.1Smrg } 1081.1Smrg . = ALIGN(32 / 8); 1091.1Smrg _end = . ; 1101.1Smrg PROVIDE (end = .); 1111.1Smrg /* Stabs debugging sections. */ 1121.1Smrg .stab 0 : { *(.stab) } 1131.1Smrg .stabstr 0 : { *(.stabstr) } 1141.1Smrg .stab.excl 0 : { *(.stab.excl) } 1151.1Smrg .stab.exclstr 0 : { *(.stab.exclstr) } 1161.1Smrg .stab.index 0 : { *(.stab.index) } 1171.1Smrg .stab.indexstr 0 : { *(.stab.indexstr) } 1181.1Smrg .comment 0 : { *(.comment) } 1191.1Smrg /* DWARF debug sections. 1201.1Smrg Symbols in the DWARF debugging sections are relative to the beginning 1211.1Smrg of the section so we begin them at 0. */ 1221.1Smrg /* DWARF 1 */ 1231.1Smrg .debug 0 : { *(.debug) } 1241.1Smrg .line 0 : { *(.line) } 1251.1Smrg /* GNU DWARF 1 extensions */ 1261.1Smrg .debug_srcinfo 0 : { *(.debug_srcinfo) } 1271.1Smrg .debug_sfnames 0 : { *(.debug_sfnames) } 1281.1Smrg /* DWARF 1.1 and DWARF 2 */ 1291.1Smrg .debug_aranges 0 : { *(.debug_aranges) } 1301.1Smrg .debug_pubnames 0 : { *(.debug_pubnames) } 1311.1Smrg /* DWARF 2 */ 1321.1Smrg .debug_info 0 : { *(.debug_info) } 1331.1Smrg .debug_abbrev 0 : { *(.debug_abbrev) } 1341.1Smrg .debug_line 0 : { *(.debug_line) } 1351.1Smrg .debug_frame 0 : { *(.debug_frame) } 1361.1Smrg .debug_str 0 : { *(.debug_str) } 1371.1Smrg .debug_loc 0 : { *(.debug_loc) } 1381.1Smrg .debug_macinfo 0 : { *(.debug_macinfo) } 1391.1Smrg /* SGI/MIPS DWARF 2 extensions */ 1401.1Smrg .debug_weaknames 0 : { *(.debug_weaknames) } 1411.1Smrg .debug_funcnames 0 : { *(.debug_funcnames) } 1421.1Smrg .debug_typenames 0 : { *(.debug_typenames) } 1431.1Smrg .debug_varnames 0 : { *(.debug_varnames) } 1441.1Smrg /* These must appear regardless of . */ 1451.7Smartin .note.netbsd.ident : 1461.7Smartin { 1471.7Smartin KEEP(*(.note.netbsd.ident)); 1481.7Smartin } 1491.1Smrg} 150