1*01442553Ssimonb/* $NetBSD: kern.ldscript,v 1.13 2021/04/23 08:42:26 simonb Exp $ */ 25a533f95Suebayasi 35a533f95Suebayasi#undef sparc 4203c1019Spk 5203c1019Spk/* 6203c1019Spk * Kernel linker script for NetBSD/sparc. This script is based on 7203c1019Spk * elf32_sparc.xn, but puts _etext after all of the read-only sections. 8203c1019Spk */ 9203c1019Spk 10203c1019SpkOUTPUT_FORMAT("elf32-sparc", "elf32-sparc", 11203c1019Spk "elf32-sparc") 12203c1019SpkOUTPUT_ARCH(sparc) 13203c1019SpkENTRY(_start) 14203c1019Spk/* Do we need any of these for elf? 15203c1019Spk __DYNAMIC = 0; */ 16203c1019SpkSECTIONS 17203c1019Spk{ 18203c1019Spk /* Read-only sections, merged into text segment: */ 19b1998403Smartin . = 0x10000 + SIZEOF_HEADERS; 20203c1019Spk .text : 21203c1019Spk { 22203c1019Spk *(.text) 23*01442553Ssimonb *(.text.*) 24203c1019Spk *(.stub) 25203c1019Spk /* .gnu.warning sections are handled specially by elf32.em. */ 26203c1019Spk *(.gnu.warning) 27203c1019Spk *(.gnu.linkonce.t*) 28203c1019Spk } =0 29203c1019Spk .rodata : { *(.rodata) *(.gnu.linkonce.r*) } 30203c1019Spk .rodata1 : { *(.rodata1) } 31203c1019Spk _etext = .; 32203c1019Spk PROVIDE (etext = .); 33203c1019Spk /* Adjust the address for the data segment. We want to adjust up to 34203c1019Spk the same address within the page on the next page up. */ 35203c1019Spk . = ALIGN(0x10000) + (. & (0x10000 - 1)); 36d713d112Spk kernel_data_start = .; 37203c1019Spk .data : 38203c1019Spk { 39203c1019Spk *(.data) 40203c1019Spk *(.gnu.linkonce.d*) 41203c1019Spk CONSTRUCTORS 42203c1019Spk } 43203c1019Spk .data1 : { *(.data1) } 44203c1019Spk .plt : { *(.plt) } 45203c1019Spk .got : { *(.got.plt) *(.got) } 46203c1019Spk .dynamic : { *(.dynamic) } 47203c1019Spk /* We want the small data sections together, so single-instruction offsets 48203c1019Spk can access them all, and initialized data all before uninitialized, so 49203c1019Spk we can shorten the on-disk segment size. */ 50203c1019Spk .sdata : { *(.sdata) } 51203c1019Spk _edata = .; 52203c1019Spk PROVIDE (edata = .); 53203c1019Spk __bss_start = .; 54203c1019Spk .sbss : { *(.sbss) *(.scommon) } 55203c1019Spk .bss : 56203c1019Spk { 57203c1019Spk *(.dynbss) 58203c1019Spk *(.bss) 59203c1019Spk *(COMMON) 60203c1019Spk } 61203c1019Spk . = ALIGN(32 / 8); 62203c1019Spk _end = . ; 63203c1019Spk PROVIDE (end = .); 64203c1019Spk} 65