Massive patch for the first months work adding System FC to GHC #15
[ghc-hetmet.git] / rts / Linker.c
index 0db2c5e..933f4dd 100644 (file)
@@ -27,6 +27,7 @@
 #include "Schedule.h"
 #include "Storage.h"
 #include "Sparks.h"
+#include "RtsTypeable.h"
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -333,6 +334,7 @@ typedef struct _RtsSymbolVal {
       Sym(mktime)                               \
       Sym(_imp___timezone)                      \
       Sym(_imp___tzname)                        \
+      Sym(_imp__tzname)                         \
       Sym(_imp___iob)                           \
       Sym(_imp___osver)                         \
       Sym(localtime)                            \
@@ -507,6 +509,7 @@ typedef struct _RtsSymbolVal {
       SymX(forkOS_createThread)                        \
       SymX(freeHaskellFunctionPtr)             \
       SymX(freeStablePtr)                      \
+      SymX(getOrSetTypeableStore)              \
       SymX(gcdIntegerzh_fast)                  \
       SymX(gcdIntegerIntzh_fast)               \
       SymX(gcdIntzh_fast)                      \
@@ -707,7 +710,8 @@ typedef struct _RtsSymbolVal {
       SymX(stg_interp_constr6_entry)            \
       SymX(stg_interp_constr7_entry)            \
       SymX(stg_interp_constr8_entry)            \
-      SymX(stgMallocBytesRWX)                   \
+      SymX(allocateExec)                       \
+      SymX(freeExec)                           \
       SymX(getAllocations)                      \
       SymX(revertCAFs)                          \
       SymX(RtsFlags)                            \
@@ -823,7 +827,7 @@ initFreeList(rootEntry *table, nat n, rootEntry *free)
   root_ptr_free = table;
 }
 
-void
+static void
 initRootPtrTable(void)
 {
   if (RPT_size > 0)
@@ -837,7 +841,7 @@ initRootPtrTable(void)
 }
 
 
-void
+static void
 enlargeRootPtrTable(void)
 {
   nat old_RPT_size = RPT_size;
@@ -856,7 +860,7 @@ static void
 addRootObject(void *addr)
 {
   StgWord rt;
-
+  initRootPtrTable();
   if (root_ptr_free == NULL) {
     enlargeRootPtrTable();
   }
@@ -954,7 +958,6 @@ initLinker( void )
       linker_init_done = 1;
     }
 
-    initRootPtrTable();
     stablehash = allocStrHashTable();
     symhash = allocStrHashTable();
 
@@ -2281,6 +2284,8 @@ ocGetNames_PEi386 ( ObjectCode* oc )
           && 0 != strcmp(".stabstr", sectab_i->Name)
           /* ignore constructor section for now */
           && 0 != strcmp(".ctors", sectab_i->Name)
+          /* ignore section generated from .ident */
+          && 0!= strcmp("/4", sectab_i->Name)
          ) {
          errorBelch("Unknown PEi386 section name `%s' (while processing: %s)", sectab_i->Name, oc->fileName);
          return 0;
@@ -2909,6 +2914,9 @@ ocVerifyImage_ELF ( ObjectCode* oc )
    IF_DEBUG(linker,debugBelch( "Architecture is " ));
    switch (ehdr->e_machine) {
       case EM_386:   IF_DEBUG(linker,debugBelch( "x86" )); break;
+#ifdef EM_SPARC32PLUS
+      case EM_SPARC32PLUS:
+#endif
       case EM_SPARC: IF_DEBUG(linker,debugBelch( "sparc" )); break;
 #ifdef EM_IA_64
       case EM_IA_64: IF_DEBUG(linker,debugBelch( "ia64" )); break;