kern.ldscript revision 1.18
1/* $NetBSD: kern.ldscript,v 1.18 2016/05/08 08:30:41 maxv Exp $ */ 2 3#include "assym.h" 4 5/* 6 * PAE is enabled by default on amd64, the large page size is therefore 7 * 2MB (and not 4MB!). 8 */ 9 10__PAGE_SIZE = 0x1000 ; 11__LARGE_PAGE_SIZE = 0x200000 ; 12 13ENTRY(_start) 14SECTIONS 15{ 16 /* Read-only sections, merged into text segment: */ 17 .text : 18 { 19 *(.text) 20 *(.text.*) 21 *(.stub) 22 } 23 _etext = . ; 24 PROVIDE (etext = .) ; 25 26 __rodata_start = . ; 27 .rodata : 28 { 29 *(.rodata) 30 *(.rodata.*) 31 } 32 33 /* 34 * Push the data segment up to the next large page boundary so that we 35 * can map the text+rodata segments with large pages. 36 */ 37 . = ALIGN(__LARGE_PAGE_SIZE); 38 39 __data_start = . ; 40 .data : 41 { 42 *(.data) 43 } 44 45 . = ALIGN(COHERENCY_UNIT); 46 .data.cacheline_aligned : 47 { 48 *(.data.cacheline_aligned) 49 } 50 . = ALIGN(COHERENCY_UNIT); 51 .data.read_mostly : 52 { 53 *(.data.read_mostly) 54 } 55 . = ALIGN(COHERENCY_UNIT); 56 57 _edata = . ; 58 PROVIDE (edata = .) ; 59 __bss_start = . ; 60 .bss : 61 { 62 *(.bss) 63 *(.bss.*) 64 *(COMMON) 65 . = ALIGN(64 / 8); 66 } 67 . = ALIGN(64 / 8); 68 _end = . ; 69 PROVIDE (end = .) ; 70 .note.netbsd.ident : 71 { 72 KEEP(*(.note.netbsd.ident)); 73 } 74} 75 76SECTIONS 77{ 78 .text : 79 AT (ADDR(.text) & 0x0fffffff) 80 { 81 *(.text) 82 } = 0 83} 84