Home | History | Annotate | Line # | Download | only in conf
kern.ldscript revision 1.24
      1 /*	$NetBSD: kern.ldscript,v 1.24 2017/08/18 10:28:53 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 
     13 ENTRY(_start)
     14 SECTIONS
     15 {
     16 	.text : AT (ADDR(.text) & 0x0fffffff)
     17 	{
     18 		*(.text)
     19 		*(.text.*)
     20 		*(.stub)
     21 		. = ALIGN(__LARGE_PAGE_SIZE);
     22 	} =0xCC
     23 	_etext = . ;
     24 	PROVIDE (etext = .) ;
     25 
     26 	/*
     27 	 * Push the rodata segment up to the next large page boundary so that we
     28 	 * can map the text segment with large pages.
     29 	 */
     30 	. = ALIGN(__LARGE_PAGE_SIZE);
     31 
     32 	__rodata_start = . ;
     33 	.rodata :
     34 	{
     35 		*(.rodata)
     36 		*(.rodata.*)
     37 	}
     38 
     39 	. = ALIGN(__LARGE_PAGE_SIZE);
     40 
     41 	__data_start = . ;
     42 	.data :
     43 	{
     44 		*(.data)
     45 	}
     46 
     47 	. = ALIGN(COHERENCY_UNIT);
     48 	.data.cacheline_aligned :
     49 	{
     50 		*(.data.cacheline_aligned)
     51 	}
     52 	. = ALIGN(COHERENCY_UNIT);
     53 	.data.read_mostly :
     54 	{
     55 		*(.data.read_mostly)
     56 	}
     57 	. = ALIGN(COHERENCY_UNIT);
     58 
     59 	_edata = . ;
     60 	PROVIDE (edata = .) ;
     61 	__bss_start = . ;
     62 	.bss :
     63 	{
     64 		*(.bss)
     65 		*(.bss.*)
     66 		*(COMMON)
     67 		. = ALIGN(__LARGE_PAGE_SIZE);
     68 	}
     69 
     70 	. = ALIGN(__PAGE_SIZE);
     71 
     72 	/* End of the kernel image */
     73 	__kernel_end = . ;
     74 
     75 	_end = . ;
     76 	PROVIDE (end = .) ;
     77 	.note.netbsd.ident :
     78 	{
     79 		KEEP(*(.note.netbsd.ident));
     80 	}
     81 }
     82 
     83