xref: /netbsd-src/sys/arch/amd64/conf/kern.ldscript.kaslr (revision cea874c7895436707b5a1cf4c2cce5d50584aef2)
1/*	$NetBSD: kern.ldscript.kaslr,v 1.5 2018/01/21 11:21:40 maxv Exp $	*/
2
3#include "assym.h"
4
5ENTRY(_start)
6SECTIONS
7{
8	.text.user : SUBALIGN(PAGE_SIZE)
9	{
10		__text_user_start = . ;
11		*(.text.user)
12		. = ALIGN(PAGE_SIZE);
13		__text_user_end = . ;
14	} =0xCC
15
16	.text :
17	{
18		*(.text)
19		*(.text.*)
20		*(.stub)
21	} =0xCC
22	_etext = . ;
23	PROVIDE (etext = .) ;
24
25	__rodata_start = . ;
26
27	.rodata.hotpatch :
28	{
29		__rodata_hotpatch_start = . ;
30		*(.rodata.hotpatch)
31		__rodata_hotpatch_end = . ;
32	}
33
34	.rodata :
35	{
36		*(.rodata)
37		*(.rodata.*)
38	}
39
40	__data_start = . ;
41	.data :
42	{
43		*(.data)
44	}
45
46	.data.cacheline_aligned : SUBALIGN(COHERENCY_UNIT)
47	{
48		*(.data.cacheline_aligned)
49		. = ALIGN(COHERENCY_UNIT);
50	}
51	.data.read_mostly : SUBALIGN(COHERENCY_UNIT)
52	{
53		*(.data.read_mostly)
54		. = ALIGN(COHERENCY_UNIT);
55	}
56
57	_edata = . ;
58	PROVIDE (edata = .) ;
59	__bss_start = . ;
60	.bss :
61	{
62		*(.bss)
63		*(.bss.*)
64		*(COMMON)
65	}
66
67	/* End of the kernel image */
68	__kernel_end = . ;
69
70	_end = . ;
71	PROVIDE (end = .) ;
72	.note.netbsd.ident :
73	{
74		KEEP(*(.note.netbsd.ident));
75	}
76
77	/DISCARD/ :
78	{
79		*(.SUNW_ctf)
80		*(.SUNW_ctf.*)
81	}
82}
83