kern.ldscript revision 1.19
1/*	$NetBSD: kern.ldscript,v 1.19 2016/05/12 06:45:16 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	__data_start = . ;
40	.data :
41	{
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	_edata = . ;
58	PROVIDE (edata = .) ;
59	__bss_start = . ;
60	.bss :
61	{
62		*(.bss)
63		*(.bss.*)
64		*(COMMON)
65		. = ALIGN(64 / 8);
66	}
67	. = ALIGN(64 / 8);
68	_end = . ;
69	PROVIDE (end = .) ;
70	.note.netbsd.ident :
71	{
72		KEEP(*(.note.netbsd.ident));
73	}
74}
75
76SECTIONS
77{
78	.text :
79	AT (ADDR(.text) & 0x0fffffff)
80	{
81		*(.text)
82	} = 0
83}
84