Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/conf Update kern.ldscript.4MB. It is the same ...



details:   https://anonhg.NetBSD.org/src/rev/b4583610f751
branches:  trunk
changeset: 345275:b4583610f751
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon May 16 07:52:31 2016 +0000

description:
Update kern.ldscript.4MB. It is the same as kern.ldscript, but with a large
page alignment before rodata.

diffstat:

 sys/arch/i386/conf/kern.ldscript.4MB |  133 ++++++++++++++++++++---------------
 1 files changed, 76 insertions(+), 57 deletions(-)

diffs (149 lines):

diff -r 24bc5ca70183 -r b4583610f751 sys/arch/i386/conf/kern.ldscript.4MB
--- a/sys/arch/i386/conf/kern.ldscript.4MB      Mon May 16 07:37:45 2016 +0000
+++ b/sys/arch/i386/conf/kern.ldscript.4MB      Mon May 16 07:52:31 2016 +0000
@@ -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 :
-  {
-    *(.rodata)
-    *(.rodata.*)
-  }
+       __rodata_start = . ;
+       .rodata :
+       {
+               *(.rodata)
+               *(.rodata.*)
+       }
+
+       . = ALIGN(__PAGE_SIZE);
+
+       __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
 }



Home | Main Index | Thread Index | Old Index