Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Simplify this by deciding load address at one place.



details:   https://anonhg.NetBSD.org/src/rev/f1331d525dfd
branches:  trunk
changeset: 810191:f1331d525dfd
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Fri Aug 21 03:36:32 2015 +0000

description:
Simplify this by deciding load address at one place.

diffstat:

 sys/arch/cats/conf/ldscript.elf      |  32 +++++++++++++++++++++-----------
 sys/arch/zaurus/conf/ldscript.zaurus |  32 +++++++++++++++++++++-----------
 2 files changed, 42 insertions(+), 22 deletions(-)

diffs (144 lines):

diff -r 6dc1c3420ede -r f1331d525dfd sys/arch/cats/conf/ldscript.elf
--- a/sys/arch/cats/conf/ldscript.elf   Fri Aug 21 02:35:52 2015 +0000
+++ b/sys/arch/cats/conf/ldscript.elf   Fri Aug 21 03:36:32 2015 +0000
@@ -1,28 +1,24 @@
-/*     $NetBSD: ldscript.elf,v 1.4 2015/08/20 07:00:48 uebayasi Exp $  */
+/*     $NetBSD: ldscript.elf,v 1.5 2015/08/21 03:42:29 uebayasi Exp $  */
 
 OUTPUT_ARCH(arm)
 ENTRY(KERNEL_BASE_phys)
 SECTIONS
 {
-  KERNEL_BASE_phys = 0xF0000000;
-  KERNEL_BASE_virt = 0xF0000000;
-
   /* Kernel start: */
-  .start (KERNEL_BASE_phys) :
+  .start :
   {
     *(.start)
-  } =0
+  }
 
   /* Read-only sections, merged into text segment: */
-  .text (KERNEL_BASE_virt + SIZEOF(.start)) :
-  AT (LOADADDR(.start) + SIZEOF(.start))
+  .text :
   {
     *(.text)
     *(.text.*)
     *(.stub)
     *(.glue_7t) *(.glue_7)
     *(.rodata) *(.rodata.*)
-  } =0
+  }
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
@@ -30,14 +26,12 @@
      boundary.  */
   . = ALIGN(0x8000);
   .data    :
-  AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
   {
     __data_start = . ;
     *(.data)
     *(.data.*)
   }
   .sdata     :
-  AT (LOADADDR(.data) + (ADDR(.sdata) - ADDR(.data)))
   {
     *(.sdata)
     *(.sdata.*)
@@ -73,3 +67,19 @@
   _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
   PROVIDE (end = .);
 }
+SECTIONS
+{
+  KERNEL_BASE_phys = 0xF0000000;
+  KERNEL_BASE_virt = 0xF0000000;
+
+  .start (KERNEL_BASE_phys) :
+  {
+    *(.start)
+  } =0
+
+  .text (KERNEL_BASE_virt + SIZEOF(.start)) :
+  AT (LOADADDR(.start) + SIZEOF(.start))
+  {
+    *(.text)
+  } =0
+}
diff -r 6dc1c3420ede -r f1331d525dfd sys/arch/zaurus/conf/ldscript.zaurus
--- a/sys/arch/zaurus/conf/ldscript.zaurus      Fri Aug 21 02:35:52 2015 +0000
+++ b/sys/arch/zaurus/conf/ldscript.zaurus      Fri Aug 21 03:36:32 2015 +0000
@@ -1,28 +1,24 @@
-/*     $NetBSD: ldscript.zaurus,v 1.7 2015/08/20 07:00:49 uebayasi Exp $       */
+/*     $NetBSD: ldscript.zaurus,v 1.8 2015/08/21 03:36:32 uebayasi Exp $       */
 
 OUTPUT_ARCH(arm)
 ENTRY(KERNEL_BASE_phys)
 SECTIONS
 {
-  KERNEL_BASE_phys = @KERNEL_BASE_PHYS@;
-  KERNEL_BASE_virt = @KERNEL_BASE_VIRT@;
-
   /* Kernel start: */
-  .start (KERNEL_BASE_phys) :
+  .start :
   {
     *(.start)
-  } =0
+  }
 
   /* Read-only sections, merged into text segment: */
-  .text (KERNEL_BASE_virt + SIZEOF(.start)) :
-  AT (LOADADDR(.start) + SIZEOF(.start))
+  .text :
   {
     *(.text)
     *(.text.*)
     *(.stub)
     *(.glue_7t) *(.glue_7)
     *(.rodata) *(.rodata.*)
-  } =0
+  }
   .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
   PROVIDE (__exidx_start = .);
   .ARM.exidx   : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
@@ -34,14 +30,12 @@
      boundary.  */
   . = ALIGN(0x8000);
   .data    :
-  AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
   {
     __data_start = . ;
     *(.data)
     *(.data.*)
   }
   .sdata     :
-  AT (LOADADDR(.data) + (ADDR(.sdata) - ADDR(.data)))
   {
     *(.sdata)
     *(.sdata.*)
@@ -87,3 +81,19 @@
     *(.rela.eh_frame)
   }
 }
+SECTIONS
+{
+  KERNEL_BASE_phys = @KERNEL_BASE_PHYS@;
+  KERNEL_BASE_virt = @KERNEL_BASE_VIRT@;
+
+  .start (KERNEL_BASE_phys) :
+  {
+    *(.start)
+  } =0
+
+  .text (KERNEL_BASE_virt + SIZEOF(.start)) :
+  AT (LOADADDR(.start) + SIZEOF(.start))
+  {
+    *(.text)
+  } =0
+}



Home | Main Index | Thread Index | Old Index