Commit 8f0f835d authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add some more linker debugging prints

parent c08d8ef0
...@@ -1608,6 +1608,7 @@ loadObj( char *path ) ...@@ -1608,6 +1608,7 @@ loadObj( char *path )
#else #else
FILE *f; FILE *f;
#endif #endif
IF_DEBUG(linker, debugBelch("loadObj %s\n", path));
initLinker(); initLinker();
/* debugBelch("loadObj %s\n", path ); */ /* debugBelch("loadObj %s\n", path ); */
...@@ -1648,7 +1649,10 @@ loadObj( char *path ) ...@@ -1648,7 +1649,10 @@ loadObj( char *path )
# endif # endif
r = stat(path, &st); r = stat(path, &st);
if (r == -1) { return 0; } if (r == -1) {
IF_DEBUG(linker, debugBelch("File doesn't exist\n"));
return 0;
}
/* sigh, strdup() isn't a POSIX function, so do it the long way */ /* sigh, strdup() isn't a POSIX function, so do it the long way */
oc->fileName = stgMallocBytes( strlen(path)+1, "loadObj" ); oc->fileName = stgMallocBytes( strlen(path)+1, "loadObj" );
...@@ -1717,10 +1721,16 @@ loadObj( char *path ) ...@@ -1717,10 +1721,16 @@ loadObj( char *path )
# if defined(OBJFORMAT_MACHO) && (defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)) # if defined(OBJFORMAT_MACHO) && (defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH))
r = ocAllocateSymbolExtras_MachO ( oc ); r = ocAllocateSymbolExtras_MachO ( oc );
if (!r) { return r; } if (!r) {
IF_DEBUG(linker, debugBelch("ocAllocateSymbolExtras_MachO failed\n"));
return r;
}
# elif defined(OBJFORMAT_ELF) && (defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)) # elif defined(OBJFORMAT_ELF) && (defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH))
r = ocAllocateSymbolExtras_ELF ( oc ); r = ocAllocateSymbolExtras_ELF ( oc );
if (!r) { return r; } if (!r) {
IF_DEBUG(linker, debugBelch("ocAllocateSymbolExtras_ELF failed\n"));
return r;
}
#endif #endif
/* verify the in-memory image */ /* verify the in-memory image */
...@@ -1733,7 +1743,10 @@ loadObj( char *path ) ...@@ -1733,7 +1743,10 @@ loadObj( char *path )
# else # else
barf("loadObj: no verify method"); barf("loadObj: no verify method");
# endif # endif
if (!r) { return r; } if (!r) {
IF_DEBUG(linker, debugBelch("ocVerifyImage_* failed\n"));
return r;
}
/* build the symbol list for this image */ /* build the symbol list for this image */
# if defined(OBJFORMAT_ELF) # if defined(OBJFORMAT_ELF)
...@@ -1745,7 +1758,10 @@ loadObj( char *path ) ...@@ -1745,7 +1758,10 @@ loadObj( char *path )
# else # else
barf("loadObj: no getNames method"); barf("loadObj: no getNames method");
# endif # endif
if (!r) { return r; } if (!r) {
IF_DEBUG(linker, debugBelch("ocGetNames_* failed\n"));
return r;
}
/* loaded, but not resolved yet */ /* loaded, but not resolved yet */
oc->status = OBJECT_LOADED; oc->status = OBJECT_LOADED;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment