kern.ldscript revision 1.17
1/*	$NetBSD: kern.ldscript,v 1.17 2016/05/07 12:45:55 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	.rodata :
27	{
28		*(.rodata)
29		*(.rodata.*)
30	}
31
32	/*
33	 * Push the data segment up to the next large page boundary so that we
34	 * can map the text+rodata segments with large pages.
35	 */
36	. = ALIGN(__LARGE_PAGE_SIZE);
37
38	__data_start = . ;
39	.data :
40	{
41		*(.data)
42	}
43
44	. = ALIGN(COHERENCY_UNIT);
45	.data.cacheline_aligned :
46	{
47		*(.data.cacheline_aligned)
48	}
49	. = ALIGN(COHERENCY_UNIT);
50	.data.read_mostly :
51	{
52		*(.data.read_mostly)
53	}
54	. = ALIGN(COHERENCY_UNIT);
55
56	_edata = . ;
57	PROVIDE (edata = .) ;
58	__bss_start = . ;
59	.bss :
60	{
61		*(.bss)
62		*(.bss.*)
63		*(COMMON)
64		. = ALIGN(64 / 8);
65	}
66	. = ALIGN(64 / 8);
67	_end = . ;
68	PROVIDE (end = .) ;
69	.note.netbsd.ident :
70	{
71		KEEP(*(.note.netbsd.ident));
72	}
73}
74
75SECTIONS
76{
77	.text :
78	AT (ADDR(.text) & 0x0fffffff)
79	{
80		*(.text)
81	} = 0
82}
83