Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amd64/conf Simplify this by splitting absolute relo...



details:   https://anonhg.NetBSD.org/src/rev/c90c48e8df1d
branches:  trunk
changeset: 340007:c90c48e8df1d
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Thu Aug 20 08:36:42 2015 +0000

description:
Simplify this by splitting absolute relocation directives from other
relative, position-independent directives.  Since all sections are
relocated in parallel, specifying the address of .text is sufficient.

diffstat:

 sys/arch/amd64/conf/kern.ldscript |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (66 lines):

diff -r c3726122931b -r c90c48e8df1d sys/arch/amd64/conf/kern.ldscript
--- a/sys/arch/amd64/conf/kern.ldscript Thu Aug 20 08:27:09 2015 +0000
+++ b/sys/arch/amd64/conf/kern.ldscript Thu Aug 20 08:36:42 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern.ldscript,v 1.10 2015/08/20 08:25:33 uebayasi Exp $        */
+/*     $NetBSD: kern.ldscript,v 1.11 2015/08/20 08:36:42 uebayasi Exp $        */
 
 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
              "elf64-x86-64")
@@ -8,7 +8,6 @@
 {
   /* Read-only sections, merged into text segment: */
   .text :
-  AT (ADDR(.text) & 0x0fffffff)
   {
     *(.text)
     *(.text.*)
@@ -18,7 +17,6 @@
   PROVIDE (etext = .) ;
 
   .rodata :
-  AT (LOADADDR(.text) + (ADDR(.rodata) - ADDR(.text)))
   {
     *(.rodata)
     *(.rodata.*)
@@ -29,20 +27,17 @@
   . = ALIGN(0x100000) + (. & (0x100000 - 1));
   __data_start = . ;
   .data :
-  AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
   {
     *(.data)
   }
 
   . = ALIGN(64);       /* COHERENCY_UNIT */
   .data.cacheline_aligned :
-  AT (LOADADDR(.text) + (ADDR(.data.cacheline_aligned) - ADDR(.text)))
   {
     *(.data.cacheline_aligned)
   }
   . = ALIGN(64);       /* COHERENCY_UNIT */
   .data.read_mostly :
-  AT (LOADADDR(.text) + (ADDR(.data.read_mostly) - ADDR(.text)))
   {
     *(.data.read_mostly)
   }
@@ -52,7 +47,6 @@
   PROVIDE (edata = .) ;
   __bss_start = . ;
   .bss :
-  AT (LOADADDR(.text) + (ADDR(.bss) - ADDR(.text)))
   {
     *(.bss)
     *(.bss.*)
@@ -67,3 +61,11 @@
     KEEP(*(.note.netbsd.ident));
   }
 }
+SECTIONS
+{
+  .text :
+  AT (ADDR(.text) & 0x0fffffff)
+  {
+    *(.text)
+  } =0
+}



Home | Main Index | Thread Index | Old Index