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