1/* $NetBSD: kern.ldscript,v 1.18 2021/04/23 08:42:26 simonb Exp $ */ 2 3#undef sparc 4 5/* 6 * Kernel linker script for NetBSD/sparc64. This script is based on 7 * elf64_sparc.xn, but puts _etext after all of the read-only sections. 8 */ 9OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", 10 "elf64-sparc") 11OUTPUT_ARCH(sparc:v9) 12ENTRY(_start) 13/* Do we need any of these for elf? 14 __DYNAMIC = 0; */ 15SECTIONS 16{ 17 /* Read-only sections, merged into text segment: */ 18 . = 0x100000 + SIZEOF_HEADERS; 19 .text : 20 { 21 *(.text) 22 *(.text.*) 23 *(.stub) 24 /* .gnu.warning sections are handled specially by elf32.em. */ 25 *(.gnu.warning) 26 *(.gnu.linkonce.t*) 27 } =0x01000000 28 .rodata : { *(.rodata) *(.gnu.linkonce.r*) } 29 .rodata1 : { *(.rodata1) } 30 _etext = .; 31 PROVIDE (etext = .); 32 /* Adjust the address for the data segment. We push the data segment 33 up to the next 4MB boundary so that we can map the text with large 34 pages. */ 35 . = ALIGN(0x400000); 36 kernel_data_start = .; 37 .data : 38 { 39 *(.data) 40 *(.gnu.linkonce.d*) 41 CONSTRUCTORS 42 } 43 .data1 : { *(.data1) } 44 . = ALIGN(64); /* COHERENCY_UNIT */ 45 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 46 . = ALIGN(64); /* COHERENCY_UNIT */ 47 .data.read_mostly : { *(.data.read_mostly) } 48 . = ALIGN(64); /* COHERENCY_UNIT */ 49 .plt : { *(.plt) } 50 .got : { *(.got.plt) *(.got) } 51 .dynamic : { *(.dynamic) } 52 /* We want the small data sections together, so single-instruction offsets 53 can access them all, and initialized data all before uninitialized, so 54 we can shorten the on-disk segment size. */ 55 .sdata : { *(.sdata) } 56 _edata = .; 57 PROVIDE (edata = .); 58 __bss_start = .; 59 .sbss : { *(.sbss) *(.scommon) } 60 .bss : 61 { 62 *(.dynbss) 63 *(.bss) 64 *(COMMON) 65 } 66 . = ALIGN(64 / 8); 67 _end = . ; 68 PROVIDE (end = .); 69 .note.netbsd.ident : 70 { 71 KEEP(*(.note.netbsd.ident)); 72 } 73} 74