/* -----------------------------------------------------------------------------
- * $Id: Linker.c,v 1.50 2001/07/17 03:53:25 qrczak Exp $
+ * $Id: Linker.c,v 1.55 2001/08/10 08:24:38 simonmar Exp $
*
* (c) The GHC Team, 2000
*
SymX(GetExitCodeProcess) \
SymX(WaitForSingleObject) \
SymX(CreateProcessA) \
+ Sym(__divdi3) \
+ Sym(__udivdi3) \
+ Sym(__moddi3) \
+ Sym(__umoddi3) \
SymX(_errno)
#endif
SymX(newArrayzh_fast) \
SymX(unsafeThawArrayzh_fast) \
SymX(newByteArrayzh_fast) \
+ SymX(newPinnedByteArrayzh_fast) \
SymX(newMutVarzh_fast) \
SymX(quotRemIntegerzh_fast) \
SymX(quotIntegerzh_fast) \
void* sym;
for (o_dll = opened_dlls; o_dll != NULL; o_dll = o_dll->next) {
/* fprintf(stderr, "look in %s for %s\n", o_dll->name, lbl); */
+ if (lbl[0] == '_') {
+ /* HACK: if the name has an initial underscore, try stripping
+ it off & look that up first. I've yet to verify whether there's
+ a Rule that governs whether an initial '_' *should always* be
+ stripped off when mapping from import lib name to the DLL name.
+ */
+ sym = GetProcAddress(o_dll->instance, (lbl+1));
+ if (sym != NULL) return sym;
+ }
sym = GetProcAddress(o_dll->instance, lbl);
if (sym != NULL) return sym;
}
return NULL;
+# else
+ ASSERT(2+2 == 5);
+ return NULL;
# endif
} else {
return val;
#if defined(sparc_TARGET_ARCH)
# define ELF_TARGET_SPARC /* Used inside <elf.h> */
+#elif defined(i386_TARGET_ARCH)
+# define ELF_TARGET_386 /* Used inside <elf.h> */
#endif
+/* There is a similar case for IA64 in the Solaris2 headers if this
+ * ever becomes relevant.
+ */
#include <elf.h>