add noDuplicatezh_fast to symbol table
[ghc-hetmet.git] / rts / Linker.c
index d0c120b..2dbcc15 100644 (file)
@@ -95,11 +95,6 @@ static /*Str*/HashTable *symhash;
 /* Hash table mapping symbol names to StgStablePtr */
 static /*Str*/HashTable *stablehash;
 
-#if defined(DEBUGGER)
-/* Hash table mapping info table ptrs to DataCon names */
-static HashTable *dchash;
-#endif 
-
 /* List of currently loaded objects */
 ObjectCode *objects = NULL;    /* initially empty */
 
@@ -462,7 +457,6 @@ typedef struct _RtsSymbolVal {
       SymX(stg_block_1)                                \
       SymX(stg_block_takemvar)                 \
       SymX(stg_block_putmvar)                  \
-      SymX(stg_seq_frame_info)                 \
       MAIN_CAP_SYM                              \
       SymX(MallocFailHook)                     \
       SymX(OnExitHook)                         \
@@ -546,7 +540,6 @@ typedef struct _RtsSymbolVal {
       SymX(insertStableSymbol)                         \
       SymX(insertSymbol)                       \
       SymX(lookupSymbol)                       \
-      SymX(lookupDataCon)                      \
       SymX(makeStablePtrzh_fast)               \
       SymX(minusIntegerzh_fast)                        \
       SymX(mkApUpd0zh_fast)                    \
@@ -559,6 +552,7 @@ typedef struct _RtsSymbolVal {
       SymX(newMVarzh_fast)                     \
       SymX(newMutVarzh_fast)                   \
       SymX(newTVarzh_fast)                     \
+      SymX(noDuplicatezh_fast)                 \
       SymX(atomicModifyMutVarzh_fast)          \
       SymX(newPinnedByteArrayzh_fast)          \
       SymX(newSpark)                           \
@@ -706,14 +700,6 @@ typedef struct _RtsSymbolVal {
       SymX(xorIntegerzh_fast)                  \
       SymX(yieldzh_fast)                        \
       SymX(stg_interp_constr_entry)             \
-      SymX(stg_interp_constr1_entry)            \
-      SymX(stg_interp_constr2_entry)            \
-      SymX(stg_interp_constr3_entry)            \
-      SymX(stg_interp_constr4_entry)            \
-      SymX(stg_interp_constr5_entry)            \
-      SymX(stg_interp_constr6_entry)            \
-      SymX(stg_interp_constr7_entry)            \
-      SymX(stg_interp_constr8_entry)            \
       SymX(allocateExec)                       \
       SymX(freeExec)                           \
       SymX(getAllocations)                      \
@@ -817,7 +803,6 @@ static RtsSymbolVal rtsSyms[] = {
 /* -----------------------------------------------------------------------------
  * Insert symbols into hash tables, checking for duplicates.
  */
-int isSuffixOf(char* x, char* suffix);
 
 static void ghciInsertStrHashTable ( char* obj_name,
                                      HashTable *table,
@@ -828,15 +813,6 @@ static void ghciInsertStrHashTable ( char* obj_name,
    if (lookupHashTable(table, (StgWord)key) == NULL)
    {
       insertStrHashTable(table, (StgWord)key, data);
-#if defined(DEBUGGER)    
-      // Insert the reverse pair in the datacon hash if it is a closure
-      {
-       if(isSuffixOf(key, "static_info") || isSuffixOf(key, "con_info")) {
-            insertHashTable(dchash, (StgWord)data, key);
-            //             debugBelch("DChash addSymbol: %s (%p)\n", key, data);
-          }
-      }
-#endif
       return;
    }
    debugBelch(
@@ -882,9 +858,6 @@ initLinker( void )
 
     stablehash = allocStrHashTable();
     symhash = allocStrHashTable();
-#if defined(DEBUGGER)
-    dchash  = allocHashTable();
-#endif
 
     /* populate the symbol table with stuff from the RTS */
     for (sym = rtsSyms; sym->lbl != NULL; sym++) {
@@ -1103,24 +1076,6 @@ lookupSymbol( char *lbl )
     }
 }
 
-#if defined(DEBUGGER)
-char * 
-lookupDataCon( StgWord addr ) 
-{
-  void *val;
-    initLinker() ;
-    ASSERT(dchash != NULL);
-    val = lookupHashTable(dchash, addr); 
-
-    return val;
-}
-#else
-char* lookupDataCon( StgWord addr )
-{
-  return NULL;
-}
-#endif
-
 static
 __attribute((unused))
 void *
@@ -1324,6 +1279,7 @@ loadObj( char *path )
     // that the actual sections end up aligned again.
    oc->misalignment = machoGetMisalignment(f);
    oc->image = stgMallocBytes(oc->fileSize + oc->misalignment, "loadObj(image)");
+   oc->image += oc->misalignment;
 #  else
    oc->image = stgMallocBytes(oc->fileSize, "loadObj(image)");
 #  endif
@@ -4397,17 +4353,3 @@ static int machoGetMisalignment( FILE * f )
 
 #endif
 
-int isSuffixOf(char* x, char* suffix) {
-  int suffix_len = strlen (suffix);
-  int x_len = strlen (x);
-  
-  if (x_len == 0)
-    return 0;
-  if (suffix_len > x_len) 
-    return 0;
-  if (suffix_len == 0) 
-    return 1;
-  
-  char* x_suffix = &x[strlen(x)-strlen(suffix)];
-  return strcmp(x_suffix, suffix) == 0;
-  }