}
}
+static
+__attribute((unused))
+void *
+lookupLocalSymbol( ObjectCode* oc, char *lbl )
+{
+ void *val;
+ initLinker() ;
+ val = lookupStrHashTable(oc->lochash, lbl);
+
+ if (val == NULL) {
+ return NULL;
+ } else {
+ return val;
+ }
+}
+
+
/* -----------------------------------------------------------------------------
* Debugging aid: look in GHCi's object symbol tables for symbols
* within DELTA bytes of the specified address, and show their names.
for (i = 0; i < oc->n_symbols; i++) {
sym = oc->symbols[i];
if (sym == NULL) continue;
+ // debugBelch("enquire %p %p\n", sym, oc->lochash);
a = NULL;
+ if (oc->lochash != NULL) {
+ a = lookupStrHashTable(oc->lochash, sym);
+ }
if (a == NULL) {
a = lookupStrHashTable(symhash, sym);
}
oc->fileSize = st.st_size;
oc->symbols = NULL;
oc->sections = NULL;
+ oc->lochash = allocStrHashTable();
oc->proddables = NULL;
/* chain it onto the list of objects */
stgFree(oc->fileName);
stgFree(oc->symbols);
stgFree(oc->sections);
+ /* The local hash table should have been freed at the end
+ of the ocResolve_ call on it. */
+ ASSERT(oc->lochash == NULL);
stgFree(oc);
return 1;
}
}
}
+ /* Free the local symbol table; we won't need it again. */
+ freeHashTable(oc->lochash, NULL);
+ oc->lochash = NULL;
+
#if defined(powerpc_HOST_ARCH)
ocFlushInstructionCache( oc );
#endif
if((symbol->n_type & N_TYPE) == N_UNDF
&& (symbol->n_type & N_EXT) && (symbol->n_value != 0))
addr = (void*) (symbol->n_value);
+ else if((addr = lookupLocalSymbol(oc,nm)) != NULL)
+ ;
else
addr = lookupSymbol(nm);
if(!addr)
return 0;
}
+ /* Free the local symbol table; we won't need it again. */
+ freeHashTable(oc->lochash, NULL);
+ oc->lochash = NULL;
+
#if defined (powerpc_HOST_ARCH)
ocFlushInstructionCache( oc );
#endif