[commit: ghc] wip/aarch64-regd: WIP (caf446c)

git at git.haskell.org git at git.haskell.org
Sun Oct 25 03:29:05 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/aarch64-regd
Link       : http://ghc.haskell.org/trac/ghc/changeset/caf446c9002de47ec1c090be6cb6254d7efc96da/ghc

>---------------------------------------------------------------

commit caf446c9002de47ec1c090be6cb6254d7efc96da
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Fri Oct 23 14:35:20 2015 +1100

    WIP


>---------------------------------------------------------------

caf446c9002de47ec1c090be6cb6254d7efc96da
 rts/Linker.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/rts/Linker.c b/rts/Linker.c
index c40af2f..d00cdb2 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -2233,9 +2233,10 @@ static StgWord getPageSize(void)
 {
     static StgWord pagesize = 0;
     if (pagesize == 0) {
-        pagesize = sysconf(_SC_PAGESIZE);
+        return sysconf(_SC_PAGESIZE);
+    } else {
+        return pagesize;
     }
-    return pagesize;
 }
 
 static StgWord roundUpToPage (StgWord size)
@@ -5165,16 +5166,20 @@ ocRunInit_PEi386 ( ObjectCode *oc )
 #define FALSE 0
 #define TRUE  1
 
-#if defined(sparc_HOST_ARCH)
+#if sparc_HOST_ARCH
 #  define ELF_TARGET_SPARC  /* Used inside <elf.h> */
-#elif defined(i386_HOST_ARCH)
+#elif i386_HOST_ARCH
 #  define ELF_TARGET_386    /* Used inside <elf.h> */
-#elif defined(x86_64_HOST_ARCH)
+#elif x86_64_HOST_ARCH
 #  define ELF_TARGET_X64_64
 #  define ELF_64BIT
 #  define ELF_TARGET_AMD64 /* Used inside <elf.h> on Solaris 11 */
-#elif defined(powerpc64_HOST_ARCH)
+#elif powerpc64_HOST_ARCH
+#  define ELF_64BIT
+#elif aarch64_HOST_ARCH
 #  define ELF_64BIT
+#else
+# error "Unknown HOST_ARCH"
 #endif
 
 #if !defined(openbsd_HOST_OS)
@@ -5392,6 +5397,8 @@ ocVerifyImage_ELF ( ObjectCode* oc )
    char*     ehdrC = (char*)(oc->image);
    Elf_Ehdr* ehdr  = (Elf_Ehdr*)ehdrC;
 
+printf ("%s %d:\n", __func__, __LINE__) ;
+
    if (ehdr->e_ident[EI_MAG0] != ELFMAG0 ||
        ehdr->e_ident[EI_MAG1] != ELFMAG1 ||
        ehdr->e_ident[EI_MAG2] != ELFMAG2 ||
@@ -5400,7 +5407,11 @@ ocVerifyImage_ELF ( ObjectCode* oc )
       return 0;
    }
 
+printf ("%s %d:\n", __func__, __LINE__) ;
+
    if (ehdr->e_ident[EI_CLASS] != ELFCLASS) {
+printf ("%s %d: ehdr->e_ident[EI_CLASS] %u     ELFCLASS %u\n", __func__, __LINE__, ehdr->e_ident[EI_CLASS], ELFCLASS) ;
+
       errorBelch("%s: unsupported ELF format", oc->fileName);
       return 0;
    }



More information about the ghc-commits mailing list