Port-amd64 archive

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

Kernel linking with new binutils



Hi,

New binutils has 

./bfd/elf64-x86-64.c:#define ELF_MAXPAGESIZE                        0x200000

as described in

http://sourceware.org/ml/binutils/2006-05/msg00279.html

This causes problems for our kernel which tries to link at 0xffffffff80100000. 

Fixes are

        1) keep this start text address by adding -z max-page-size=0x100000; or
        2) by allowing the new maxpage alignment with the attached diff. I
           suppose that LARGEPAGES could die as a result?

Anyone got any strong preference?

Nick
Index: sys/arch/amd64/conf/Makefile.amd64
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/conf/Makefile.amd64,v
retrieving revision 1.26
diff -u -p -u -r1.26 Makefile.amd64
--- sys/arch/amd64/conf/Makefile.amd64  11 Dec 2008 05:27:42 -0000      1.26
+++ sys/arch/amd64/conf/Makefile.amd64  24 Sep 2009 10:49:33 -0000
@@ -65,7 +65,7 @@ spl.o: ${AMD64}/amd64/spl.S assym.h
 ##
 ## (5) link settings
 ##
-TEXTADDR?=     0xffffffff80100000
+TEXTADDR?=     0xffffffff80200000
 LINKFLAGS_NORMAL=      -X
 KERN_LDSCRIPT?= kern.ldscript
 LINKFORMAT=    -T ${AMD64}/conf/${KERN_LDSCRIPT}
Index: sys/arch/amd64/conf/kern.ldscript
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/conf/kern.ldscript,v
retrieving revision 1.4
diff -u -p -u -r1.4 kern.ldscript
--- sys/arch/amd64/conf/kern.ldscript   18 Oct 2007 15:28:33 -0000      1.4
+++ sys/arch/amd64/conf/kern.ldscript   24 Sep 2009 10:49:33 -0000
@@ -26,7 +26,7 @@ SECTIONS
  
    /* Adjust the address for the data segment.  We want to adjust up to
       the same address within the page on the next page up.  */
-   . = ALIGN(0x100000) + (. & (0x100000 - 1));
+   . = ALIGN(0x200000) + (. & (0x200000 - 1));
    __data_start = . ;
    .data :
    AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
Index: sys/arch/amd64/conf/kern.ldscript.Xen
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/conf/kern.ldscript.Xen,v
retrieving revision 1.2
diff -u -p -u -r1.2 kern.ldscript.Xen
--- sys/arch/amd64/conf/kern.ldscript.Xen       22 Nov 2007 16:16:44 -0000      
1.2
+++ sys/arch/amd64/conf/kern.ldscript.Xen       24 Sep 2009 10:49:33 -0000
@@ -20,7 +20,7 @@ SECTIONS
 
    /* Adjust the address for the data segment.  We want to adjust up to
       the same address within the page on the next page up.  */
-   . = ALIGN(0x100000) + (. & (0x100000 - 1));
+   . = ALIGN(0x200000) + (. & (0x200000 - 1));
    __data_start = . ;
    .data :
    AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))


Home | Main Index | Thread Index | Old Index