From: John Hodge Date: Thu, 14 Jun 2012 08:47:38 +0000 (+0800) Subject: Kernel/modules - moved relocation to before dep checks, the strings need to be reloca... X-Git-Tag: rel0.15~611^2~57 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=18cee9bfed176b900c2d497ee49b55797363e049;p=tpg%2Facess2.git Kernel/modules - moved relocation to before dep checks, the strings need to be relocated first :/ --- diff --git a/KernelLand/Kernel/modules.c b/KernelLand/Kernel/modules.c index e3e0ebeb..8202b086 100644 --- a/KernelLand/Kernel/modules.c +++ b/KernelLand/Kernel/modules.c @@ -351,9 +351,17 @@ int Module_LoadFile(const char *Path, const char *ArgString) Log_Warning("Module", "Module_LoadFile - Unable to load '%s'", Path); return 0; } + + // TODO: I need a way of relocating the dependencies before everything else, so + // they can be resolved before any other link errors + if( !Binary_Relocate(base) ) { + Log_Warning("Relocation of module %s failed", Path); + Binary_Unload(base); + return 0; + } // Check for Acess Driver - if( Binary_FindSymbol(base, "DriverInfo", (Uint*)&info ) ) + if( Binary_FindSymbol(base, "DriverInfo", (Uint*)&info ) == 0 ) { for( loader = gModule_Loaders; loader; loader = loader->Next) { @@ -375,12 +383,6 @@ int Module_LoadFile(const char *Path, const char *ArgString) return 0; } - if( !Binary_Relocate(base) ) { - Log_Warning("Relocation of module %s failed", Path); - Binary_Unload(base); - return 0; - } - // Initialise (and register) if( loader ? loader->Loader(base) : Module_int_Initialise( info, ArgString ) ) {