summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormaxv <maxv@NetBSD.org>2016-05-16 07:52:31 +0000
committermaxv <maxv@NetBSD.org>2016-05-16 07:52:31 +0000
commitda47b4dadc9fef89eb28f074b9de8dec9de9bee1 (patch)
treeceac1f750170a94398f251393549f3770febda2a /sys
parent1673c13037ed65475765e016e0ba94bdc8943b01 (diff)
Update kern.ldscript.4MB. It is the same as kern.ldscript, but with a large
page alignment before rodata.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/conf/kern.ldscript.4MB133
1 files changed, 76 insertions, 57 deletions
diff --git a/sys/arch/i386/conf/kern.ldscript.4MB b/sys/arch/i386/conf/kern.ldscript.4MB
index 98f3449b2be..83e01d29427 100644
--- a/sys/arch/i386/conf/kern.ldscript.4MB
+++ b/sys/arch/i386/conf/kern.ldscript.4MB
@@ -1,69 +1,88 @@
-/* $NetBSD: kern.ldscript.4MB,v 1.16 2015/08/25 12:56:58 uebayasi Exp $ */
+/* $NetBSD: kern.ldscript.4MB,v 1.17 2016/05/16 07:52:31 maxv Exp $ */
#include "assym.h"
+/*
+ * The large page size is 4MB in the non-PAE case.
+ */
+
+__PAGE_SIZE = 0x1000 ;
+__LARGE_PAGE_SIZE = 0x400000 ;
+
ENTRY(_start)
SECTIONS
{
- /* Read-only sections, merged into text segment: */
- .text :
- {
- *(.text)
- *(.text.*)
- *(.stub)
- }
- _etext = . ;
- PROVIDE (etext = .) ;
+ .text :
+ {
+ *(.text)
+ *(.text.*)
+ *(.stub)
+ }
+ _etext = . ;
+ PROVIDE (etext = .) ;
+
+ /*
+ * Push the rodata segment up to the next large page boundary so that we
+ * can map the text segment with large pages.
+ */
+ . = ALIGN(__LARGE_PAGE_SIZE);
+
+ __rodata_start = . ;
+ .rodata :
+ {
+ *(.rodata)
+ *(.rodata.*)
+ }
+
+ . = ALIGN(__PAGE_SIZE);
- .rodata :
- {
- *(.rodata)
- *(.rodata.*)
- }
+ __data_start = . ;
+ .data :
+ {
+ *(.data)
+ }
- /* Adjust the address for the data segment. We push the data segment
- up to the next 4MB boundary so that we can map the text with large
- pages. */
- . = ALIGN(0x400000);
- __data_start = . ;
- .data :
- {
- *(.data)
- }
- . = ALIGN(COHERENCY_UNIT);
- .data.cacheline_aligned :
- {
- *(.data.cacheline_aligned)
- }
- . = ALIGN(COHERENCY_UNIT);
- .data.read_mostly :
- {
- *(.data.read_mostly)
- }
- . = ALIGN(COHERENCY_UNIT);
- _edata = . ;
- PROVIDE (edata = .) ;
- __bss_start = . ;
- .bss :
- {
- *(.bss)
- *(.bss.*)
- *(COMMON)
- . = ALIGN(32 / 8);
- }
- . = ALIGN(32 / 8);
- _end = . ;
- PROVIDE (end = .) ;
- .note.netbsd.ident :
- {
- KEEP(*(.note.netbsd.ident));
- }
+ . = ALIGN(COHERENCY_UNIT);
+ .data.cacheline_aligned :
+ {
+ *(.data.cacheline_aligned)
+ }
+ . = ALIGN(COHERENCY_UNIT);
+ .data.read_mostly :
+ {
+ *(.data.read_mostly)
+ }
+ . = ALIGN(COHERENCY_UNIT);
+
+ _edata = . ;
+ PROVIDE (edata = .) ;
+ __bss_start = . ;
+ .bss :
+ {
+ *(.bss)
+ *(.bss.*)
+ *(COMMON)
+ . = ALIGN(32 / 8);
+ }
+
+ . = ALIGN(__PAGE_SIZE);
+
+ /* End of the kernel image */
+ __kernel_end = . ;
+
+ _end = . ;
+ PROVIDE (end = .) ;
+ .note.netbsd.ident :
+ {
+ KEEP(*(.note.netbsd.ident));
+ }
}
+
SECTIONS
{
- .text :
- AT (ADDR(.text) & 0x0fffffff)
- {
- *(.text)
- } =0
+ .text :
+ AT (ADDR(.text) & 0x0fffffff)
+ {
+ *(.text)
+ } = 0
}