1 1.26 maxv /* $NetBSD: kern.ldscript,v 1.26 2018/01/21 11:21:40 maxv Exp $ */ 2 1.1 fvdl 3 1.15 uebayasi #include "assym.h" 4 1.15 uebayasi 5 1.17 maxv /* 6 1.17 maxv * PAE is enabled by default on amd64, the large page size is therefore 7 1.17 maxv * 2MB (and not 4MB!). 8 1.17 maxv */ 9 1.17 maxv 10 1.17 maxv __PAGE_SIZE = 0x1000 ; 11 1.17 maxv __LARGE_PAGE_SIZE = 0x200000 ; 12 1.17 maxv 13 1.1 fvdl ENTRY(_start) 14 1.1 fvdl SECTIONS 15 1.1 fvdl { 16 1.24 maxv .text : AT (ADDR(.text) & 0x0fffffff) 17 1.16 maxv { 18 1.26 maxv . = ALIGN(__PAGE_SIZE); 19 1.26 maxv __text_user_start = . ; 20 1.26 maxv *(.text.user) 21 1.26 maxv . = ALIGN(__PAGE_SIZE); 22 1.26 maxv __text_user_end = . ; 23 1.26 maxv 24 1.16 maxv *(.text) 25 1.16 maxv *(.text.*) 26 1.16 maxv *(.stub) 27 1.24 maxv . = ALIGN(__LARGE_PAGE_SIZE); 28 1.24 maxv } =0xCC 29 1.16 maxv _etext = . ; 30 1.16 maxv PROVIDE (etext = .) ; 31 1.16 maxv 32 1.19 maxv /* 33 1.19 maxv * Push the rodata segment up to the next large page boundary so that we 34 1.19 maxv * can map the text segment with large pages. 35 1.19 maxv */ 36 1.19 maxv . = ALIGN(__LARGE_PAGE_SIZE); 37 1.19 maxv 38 1.18 maxv __rodata_start = . ; 39 1.25 maxv 40 1.25 maxv .rodata.hotpatch : 41 1.25 maxv { 42 1.25 maxv __rodata_hotpatch_start = . ; 43 1.25 maxv *(.rodata.hotpatch) 44 1.25 maxv __rodata_hotpatch_end = . ; 45 1.25 maxv } 46 1.25 maxv 47 1.16 maxv .rodata : 48 1.16 maxv { 49 1.16 maxv *(.rodata) 50 1.16 maxv *(.rodata.*) 51 1.16 maxv } 52 1.16 maxv 53 1.22 maxv . = ALIGN(__LARGE_PAGE_SIZE); 54 1.20 maxv 55 1.16 maxv __data_start = . ; 56 1.16 maxv .data : 57 1.16 maxv { 58 1.16 maxv *(.data) 59 1.16 maxv } 60 1.16 maxv 61 1.16 maxv . = ALIGN(COHERENCY_UNIT); 62 1.16 maxv .data.cacheline_aligned : 63 1.16 maxv { 64 1.16 maxv *(.data.cacheline_aligned) 65 1.16 maxv } 66 1.16 maxv . = ALIGN(COHERENCY_UNIT); 67 1.16 maxv .data.read_mostly : 68 1.16 maxv { 69 1.16 maxv *(.data.read_mostly) 70 1.16 maxv } 71 1.16 maxv . = ALIGN(COHERENCY_UNIT); 72 1.16 maxv 73 1.16 maxv _edata = . ; 74 1.16 maxv PROVIDE (edata = .) ; 75 1.16 maxv __bss_start = . ; 76 1.16 maxv .bss : 77 1.16 maxv { 78 1.16 maxv *(.bss) 79 1.16 maxv *(.bss.*) 80 1.16 maxv *(COMMON) 81 1.23 maxv . = ALIGN(__LARGE_PAGE_SIZE); 82 1.16 maxv } 83 1.21 maxv 84 1.23 maxv . = ALIGN(__PAGE_SIZE); 85 1.21 maxv 86 1.21 maxv /* End of the kernel image */ 87 1.21 maxv __kernel_end = . ; 88 1.21 maxv 89 1.16 maxv _end = . ; 90 1.16 maxv PROVIDE (end = .) ; 91 1.16 maxv .note.netbsd.ident : 92 1.16 maxv { 93 1.16 maxv KEEP(*(.note.netbsd.ident)); 94 1.16 maxv } 95 1.1 fvdl } 96 1.16 maxv 97