Home | History | Annotate | Line # | Download | only in conf
      1 /*	$NetBSD: kern.ldscript,v 1.8 2021/05/01 07:13:21 skrll Exp $	*/
      2 
      3 #include "assym.h"
      4 
      5 OUTPUT_ARCH(riscv)
      6 ENTRY(start)
      7 
      8 __PAGE_SIZE = 0x1000 ;
      9 __LARGE_PAGE_SIZE = 0x200000 ;
     10 
     11 SECTIONS
     12 {
     13 
     14 	.text : AT (KERNEL_PHYS)
     15 	{
     16 		PROVIDE(__kernel_text = .);
     17 		*(.text)
     18 		*(.text.*)
     19 		*(.stub)
     20 	}
     21 	_etext = . ;
     22 	PROVIDE (etext = .);
     23 
     24 	. = ALIGN(__LARGE_PAGE_SIZE);
     25 
     26 	PROVIDE(__rodata_start = .);
     27 	.rodata :
     28 	{
     29 		*(.rodata)
     30 		*(.rodata.*)
     31 		*(.srodata)
     32 		*(.srodata.*)
     33 	}
     34 
     35 	PROVIDE(_etext = .);
     36 	PROVIDE(etext = .);
     37 	. = ALIGN(__LARGE_PAGE_SIZE);
     38 
     39 	.data :
     40 	{
     41 		PROVIDE(__data_start = .);
     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 	.sdata :
     58 	{
     59 		__global_pointer$ = . + 0x800;
     60 		*(.sdata)
     61 		*(.sdata.*)
     62 	}
     63 	_edata = .;
     64 	PROVIDE (edata = .);
     65 
     66 	__bss_start = .;
     67 	.bss :
     68 	{
     69 		*(.bss)
     70 		*(.bss.*)
     71 		*(.sbss)
     72 		*(.sbss.*)
     73 		*(COMMON)
     74 		. = ALIGN(__LARGE_PAGE_SIZE);
     75 	}
     76 	_bss_end__ = . ;
     77 	__bss_end__ = . ;
     78 	. = ALIGN(__PAGE_SIZE);
     79 
     80 	__end__ = . ;
     81 	_end = .;
     82 	PROVIDE(end = .);
     83 	.note.netbsd.ident :
     84 	{
     85 		KEEP(*(.note.netbsd.ident));
     86 	}
     87 }
     88