Update kern.ldscript.4MB. It is the same as kern.ldscript, but with a large

page alignment before rodata.
This commit is contained in:
maxv 2016-05-16 07:52:31 +00:00
parent 683c80c88e
commit 9c4befc9b2
1 changed files with 76 additions and 57 deletions

View File

@ -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 = .) ;
.rodata :
{
*(.rodata)
*(.rodata.*)
}
/*
* 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);
/* 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));
}
__rodata_start = . ;
.rodata :
{
*(.rodata)
*(.rodata.*)
}
. = ALIGN(__PAGE_SIZE);
__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(__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
}