1 1.31 manu /* $NetBSD: kern.ldscript,v 1.31 2020/01/09 00:42:24 manu 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.31 manu .text : AT (ADDR(.text) & 0x0fffffff) 17 1.16 maxv { 18 1.29 manu . = 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.27 maxv . = ALIGN(COHERENCY_UNIT); 52 1.27 maxv __CTOR_LIST__ = .; 53 1.27 maxv *(.ctors) 54 1.27 maxv __CTOR_END__ = .; 55 1.16 maxv } 56 1.16 maxv 57 1.22 maxv . = ALIGN(__LARGE_PAGE_SIZE); 58 1.20 maxv 59 1.16 maxv __data_start = . ; 60 1.16 maxv .data : 61 1.16 maxv { 62 1.16 maxv *(.data) 63 1.16 maxv } 64 1.16 maxv 65 1.16 maxv . = ALIGN(COHERENCY_UNIT); 66 1.16 maxv .data.cacheline_aligned : 67 1.16 maxv { 68 1.16 maxv *(.data.cacheline_aligned) 69 1.16 maxv } 70 1.16 maxv . = ALIGN(COHERENCY_UNIT); 71 1.16 maxv .data.read_mostly : 72 1.16 maxv { 73 1.16 maxv *(.data.read_mostly) 74 1.16 maxv } 75 1.16 maxv . = ALIGN(COHERENCY_UNIT); 76 1.16 maxv 77 1.16 maxv _edata = . ; 78 1.16 maxv PROVIDE (edata = .) ; 79 1.16 maxv __bss_start = . ; 80 1.16 maxv .bss : 81 1.16 maxv { 82 1.16 maxv *(.bss) 83 1.16 maxv *(.bss.*) 84 1.16 maxv *(COMMON) 85 1.23 maxv . = ALIGN(__LARGE_PAGE_SIZE); 86 1.16 maxv } 87 1.21 maxv 88 1.23 maxv . = ALIGN(__PAGE_SIZE); 89 1.21 maxv 90 1.21 maxv /* End of the kernel image */ 91 1.21 maxv __kernel_end = . ; 92 1.21 maxv 93 1.16 maxv _end = . ; 94 1.16 maxv PROVIDE (end = .) ; 95 1.16 maxv .note.netbsd.ident : 96 1.16 maxv { 97 1.16 maxv KEEP(*(.note.netbsd.ident)); 98 1.16 maxv } 99 1.1 fvdl } 100 1.16 maxv 101