kern32.ldscript revision 1.15
1/* $NetBSD: kern32.ldscript,v 1.15 2015/08/24 08:13:07 uebayasi 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) 12/* Do we need any of these for elf? 13 __DYNAMIC = 0; */ 14SECTIONS 15{ 16 /* Read-only sections, merged into text segment: */ 17 . = 0x10000 + SIZEOF_HEADERS; 18 .text : 19 { 20 *(.text) 21 *(.stub) 22 /* .gnu.warning sections are handled specially by elf32.em. */ 23 *(.gnu.warning) 24 *(.gnu.linkonce.t*) 25 } =0 26 .rodata : { *(.rodata) *(.gnu.linkonce.r*) } 27 .rodata1 : { *(.rodata1) } 28 _etext = .; 29 PROVIDE (etext = .); 30 /* Adjust the address for the data segment. We push the data segment 31 up to the next 4MB boundary so that we can map the text with large 32 pages. */ 33 . = ALIGN(0x400000); 34 kernel_data_start = .; 35 .data : 36 { 37 *(.data) 38 *(.gnu.linkonce.d*) 39 CONSTRUCTORS 40 } 41 .data1 : { *(.data1) } 42 . = ALIGN(64); /* COHERENCY_UNIT */ 43 .data.cacheline_aligned : { *(.data_cacheline_aligned) } 44 . = ALIGN(64); /* COHERENCY_UNIT */ 45 .data.read_mostly : { *(.data.read_mostly) } 46 . = ALIGN(64); /* COHERENCY_UNIT */ 47 .plt : { *(.plt) } 48 .got : { *(.got.plt) *(.got) } 49 .dynamic : { *(.dynamic) } 50 /* We want the small data sections together, so single-instruction offsets 51 can access them all, and initialized data all before uninitialized, so 52 we can shorten the on-disk segment size. */ 53 .sdata : { *(.sdata) } 54 _edata = .; 55 PROVIDE (edata = .); 56 __bss_start = .; 57 .sbss : { *(.sbss) *(.scommon) } 58 .bss : 59 { 60 *(.dynbss) 61 *(.bss) 62 *(COMMON) 63 } 64 . = ALIGN(32 / 8); 65 _end = . ; 66 PROVIDE (end = .); 67 .note.netbsd.ident : 68 { 69 KEEP(*(.note.netbsd.ident)); 70 } 71} 72