Module Name:    src
Committed By:   uebayasi
Date:           Thu Aug 20 08:36:42 UTC 2015

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

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/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/amd64/conf/kern.ldscript
diff -u src/sys/arch/amd64/conf/kern.ldscript:1.10 src/sys/arch/amd64/conf/kern.ldscript:1.11
--- src/sys/arch/amd64/conf/kern.ldscript:1.10	Thu Aug 20 08:25:33 2015
+++ src/sys/arch/amd64/conf/kern.ldscript	Thu Aug 20 08:36:42 2015
@@ -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 @@ SECTIONS
 {
   /* Read-only sections, merged into text segment: */
   .text :
-  AT (ADDR(.text) & 0x0fffffff)
   {
     *(.text)
     *(.text.*)
@@ -18,7 +17,6 @@ SECTIONS
   PROVIDE (etext = .) ;
 
   .rodata :
-  AT (LOADADDR(.text) + (ADDR(.rodata) - ADDR(.text)))
   {
     *(.rodata)
     *(.rodata.*)
@@ -29,20 +27,17 @@ SECTIONS
   . = 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 @@ SECTIONS
   PROVIDE (edata = .) ;
   __bss_start = . ;
   .bss :
-  AT (LOADADDR(.text) + (ADDR(.bss) - ADDR(.text)))
   {
     *(.bss)
     *(.bss.*)
@@ -67,3 +61,11 @@ SECTIONS
     KEEP(*(.note.netbsd.ident));
   }
 }
+SECTIONS
+{
+  .text :
+  AT (ADDR(.text) & 0x0fffffff)
+  {
+    *(.text)
+  } =0
+}

Reply via email to