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