Module Name:    src
Committed By:   uwe
Date:           Mon Dec 18 23:12:43 UTC 2023

Modified Files:
        src/sys/arch/netwinder/conf: kern.ldscript

Log Message:
netwinder: fix base, minimize kern.ldscript diff with evbarm

New binutils align to 0x10000, not 0x8000 (which makes sense), so
adjust the base to be 0x10000 so that we are loaded at a page boundary
and (I guess) don't smash the firmware in the first page.  While here,
sync with ldscript.evbarm.

Makes my netwinder boot again.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/netwinder/conf/kern.ldscript

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/netwinder/conf/kern.ldscript
diff -u src/sys/arch/netwinder/conf/kern.ldscript:1.10 src/sys/arch/netwinder/conf/kern.ldscript:1.11
--- src/sys/arch/netwinder/conf/kern.ldscript:1.10	Sun Aug 23 08:57:25 2015
+++ src/sys/arch/netwinder/conf/kern.ldscript	Mon Dec 18 23:12:43 2023
@@ -1,29 +1,45 @@
-/*	$NetBSD: kern.ldscript,v 1.10 2015/08/23 08:57:25 uebayasi Exp $	*/
+/*	$NetBSD: kern.ldscript,v 1.11 2023/12/18 23:12:43 uwe Exp $	*/
 
-ENTRY(KERNEL_BASE_phys)
 SECTIONS
 {
+  KERNEL_BASE_phys = 0x00010000;
+  KERNEL_BASE_virt = 0xf0010000;
+
   /* Kernel start: */
-  .start :
+  .start (KERNEL_BASE_phys) :
   {
     *(.start)
   }
 
   /* Read-only sections, merged into text segment: */
-  .text :
+  .text (KERNEL_BASE_virt + SIZEOF(.start)) :
+  AT (LOADADDR(.start) + SIZEOF(.start))
   {
     *(.text)
     *(.text.*)
     *(.stub)
     *(.glue_7t) *(.glue_7)
-    *(.rodata) *(.rodata.*)
   }
+
+  PROVIDE(__rodata_start = .);
+  .rodata :
+  {
+    *(.rodata)
+    *(.rodata.*)
+    . = ALIGN(64);
+    __CTOR_LIST__ = .;
+    *(.ctors)
+    *(.init_array)
+    __CTOR_END__ = .;
+  }
+
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
-  /* Adjust the address for the data segment to start on the next page
+
+  /* Adjust the address for the data segment to start on the next large page
      boundary.  */
-  . = ALIGN(0x8000);
+  . = ALIGN(0x10000);
   .data    :
   {
     __data_start = . ;
@@ -35,6 +51,7 @@ SECTIONS
     *(.sdata)
     *(.sdata.*)
   }
+  . = ALIGN(8);
   _edata = .;
   PROVIDE (edata = .);
   __bss_start = .;
@@ -66,25 +83,3 @@ SECTIONS
   _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
   PROVIDE (end = .);
 }
-SECTIONS
-{
-  KERNEL_BASE_phys = 0x0000c000;
-  KERNEL_BASE_virt = 0xf000c000;
-
-  .start (KERNEL_BASE_phys) :
-  {
-    *(.start)
-  } =0
-
-  .text (KERNEL_BASE_virt + SIZEOF(.start)) :
-  AT (LOADADDR(.start) + SIZEOF(.start))
-  {
-    *(.text)
-  } =0
-
-  .data :
-  AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
-  {
-    *(.data)
-  }
-}

Reply via email to