kern.ldscript revision 1.20
1/*	$NetBSD: kern.ldscript,v 1.20 2016/05/12 07:21:18 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
13ENTRY(_start)
14SECTIONS
15{
16	/* Read-only sections, merged into text segment: */
17	.text :
18	{
19		*(.text)
20		*(.text.*)
21		*(.stub)
22	}
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(__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(64 / 8);
68	}
69	. = ALIGN(64 / 8);
70	_end = . ;
71	PROVIDE (end = .) ;
72	.note.netbsd.ident :
73	{
74		KEEP(*(.note.netbsd.ident));
75	}
76}
77
78SECTIONS
79{
80	.text :
81	AT (ADDR(.text) & 0x0fffffff)
82	{
83		*(.text)
84	} = 0
85}
86