/* -----------------------------------------------------------------------------
- * $Id: Linker.c,v 1.147 2004/05/15 15:35:47 dons Exp $
*
- * (c) The GHC Team, 2000-2003
+ * (c) The GHC Team, 2000-2004
*
* RTS Object Linker
*
SymX(StackOverflowHook) \
SymX(__encodeDouble) \
SymX(__encodeFloat) \
+ SymX(addDLL) \
SymX(__gmpn_gcd_1) \
SymX(__gmpz_cmp) \
SymX(__gmpz_cmp_si) \
SymX(__int_encodeDouble) \
SymX(__int_encodeFloat) \
SymX(andIntegerzh_fast) \
+ SymX(barf) \
SymX(blockAsyncExceptionszh_fast) \
SymX(catchzh_fast) \
SymX(cmp_thread) \
SymX(genSymZh) \
SymX(getProgArgv) \
SymX(getStablePtr) \
+ SymX(initLinker) \
SymX(int2Integerzh_fast) \
SymX(integer2Intzh_fast) \
SymX(integer2Wordzh_fast) \
SymX(isFloatNaN) \
SymX(isFloatNegativeZero) \
SymX(killThreadzh_fast) \
+ SymX(loadObj) \
+ SymX(lookupSymbol) \
SymX(makeStablePtrzh_fast) \
SymX(minusIntegerzh_fast) \
SymX(mkApUpd0zh_fast) \
SymX(remIntegerzh_fast) \
SymX(resetNonBlockingFd) \
SymX(resumeThread) \
+ SymX(resolveObjs) \
SymX(rts_apply) \
SymX(rts_checkSchedStatus) \
SymX(rts_eval) \
SymX(tryPutMVarzh_fast) \
SymX(tryTakeMVarzh_fast) \
SymX(unblockAsyncExceptionszh_fast) \
+ SymX(unloadObj) \
SymX(unsafeThawArrayzh_fast) \
SymX(waitReadzh_fast) \
SymX(waitWritezh_fast) \
/* fprintf(stderr, "loadObj %s\n", path ); */
- /* Check that we haven't already loaded this object. Don't give up
- at this stage; ocGetNames_* will barf later. */
+ /* Check that we haven't already loaded this object.
+ Ignore requests to load multiple times */
{
ObjectCode *o;
int is_dup = 0;
for (o = objects; o; o = o->next) {
- if (0 == strcmp(o->fileName, path))
+ if (0 == strcmp(o->fileName, path)) {
is_dup = 1;
+ break; /* don't need to search further */
+ }
}
if (is_dup) {
- fprintf(stderr,
- "\n\n"
+ IF_DEBUG(linker, belch(
"GHCi runtime linker: warning: looks like you're trying to load the\n"
"same object file twice:\n"
" %s\n"
- "GHCi will continue, but a duplicate-symbol error may shortly follow.\n"
- "\n"
- , path);
+ "GHCi will ignore this, but be warned.\n"
+ , path));
+ return 1; /* success */
}
}