X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=KernelLand%2FKernel%2Fmodules.c;h=8202b086671f8583b7cb2572d1fe7f07e809c39a;hb=ff00630ed805237683c2f8fa47765a1cf5a07578;hp=e3e0ebeba68cb5ca753bca981a828b38222ff1bb;hpb=67c9c489ba80c23739854905cf6d2f378193c9a8;p=tpg%2Facess2.git 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 ) ) {