From: John Hodge Date: Fri, 15 Jan 2010 15:41:34 +0000 (+0800) Subject: Fixed Double-Relocation in modules.c (edited bin/elf.c to find this) X-Git-Tag: rel0.06~329 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=fbb51904de075386178cc6bb14717132d3b2153d;p=tpg%2Facess2.git Fixed Double-Relocation in modules.c (edited bin/elf.c to find this) --- diff --git a/Kernel/Makefile.BuildNum b/Kernel/Makefile.BuildNum index f432c251..87dafb4e 100644 --- a/Kernel/Makefile.BuildNum +++ b/Kernel/Makefile.BuildNum @@ -1 +1 @@ -BUILD_NUM = 1339 +BUILD_NUM = 1342 diff --git a/Kernel/bin/elf.c b/Kernel/bin/elf.c index 9381b5cf..4bc13b16 100644 --- a/Kernel/bin/elf.c +++ b/Kernel/bin/elf.c @@ -461,7 +461,7 @@ int Elf_Int_DoRelocate(Uint r_info, Uint32 *ptr, Uint32 addend, Elf32_Sym *symta if( !Elf_GetSymbol((void*)base, sSymName, &val) ) // Search this binary first if( !Binary_GetSymbol( sSymName, &val ) ) return 0; - //LOG("R_386_32 *0x%x += 0x%x('%s')", ptr, val, sSymName); + LOG("R_386_32 *0x%x += 0x%x('%s')", ptr, val, sSymName); *ptr = val + addend; break; @@ -470,7 +470,7 @@ int Elf_Int_DoRelocate(Uint r_info, Uint32 *ptr, Uint32 addend, Elf32_Sym *symta if( !Elf_GetSymbol( (void*)base, sSymName, &val ) ) if( !Binary_GetSymbol( sSymName, &val ) ) return 0; - //LOG("R_386_PC32 *0x%x = 0x%x + 0x%x('%s') - 0x%x", ptr, *ptr, val, sSymName, (Uint)ptr ); + LOG("R_386_PC32 *0x%x = 0x%x + 0x%x('%s') - 0x%x", ptr, *ptr, val, sSymName, (Uint)ptr ); // TODO: Check if it needs the true value of ptr or the compiled value // NOTE: Testing using true value *ptr = val + addend - (Uint)ptr; @@ -481,7 +481,7 @@ int Elf_Int_DoRelocate(Uint r_info, Uint32 *ptr, Uint32 addend, Elf32_Sym *symta if( !Elf_GetSymbol( (void*)base, sSymName, &val ) ) if( !Binary_GetSymbol( sSymName, &val ) ) return 0; - //LOG("R_386_GLOB_DAT *0x%x = 0x%x (%s)", ptr, val, sSymName); + LOG("R_386_GLOB_DAT *0x%x = 0x%x (%s)", ptr, val, sSymName); *ptr = val; break; @@ -490,13 +490,13 @@ int Elf_Int_DoRelocate(Uint r_info, Uint32 *ptr, Uint32 addend, Elf32_Sym *symta if( !Elf_GetSymbol( (void*)base, sSymName, &val ) ) if( !Binary_GetSymbol( sSymName, &val ) ) return 0; - //LOG("R_386_JMP_SLOT *0x%x = 0x%x (%s)", ptr, val, sSymName); + LOG("R_386_JMP_SLOT *0x%x = 0x%x (%s)", ptr, val, sSymName); *ptr = val; break; // Base Address (B+A) case R_386_RELATIVE: - //LOG("R_386_RELATIVE *0x%x = 0x%x + 0x%x", ptr, base, addend); + LOG("R_386_RELATIVE *0x%x = 0x%x + 0x%x", ptr, base, addend); *ptr = base + addend; break; diff --git a/Kernel/modules.c b/Kernel/modules.c index 93de973d..a206cf97 100644 --- a/Kernel/modules.c +++ b/Kernel/modules.c @@ -156,7 +156,6 @@ int Module_LoadFile(char *Path, char *ArgString) // Check for EDI Driver if( Binary_FindSymbol(base, "driver_init", NULL ) != 0 ) { - Binary_Relocate(base); // Relocate return Module_InitEDI( base ); // And intialise } #endif @@ -164,7 +163,6 @@ int Module_LoadFile(char *Path, char *ArgString) #if USE_UDI if( Binary_FindSymbol(base, "udi_init_info", NULL ) != 0 ) { - Binary_Relocate(base); // Relocate return UDI_LoadDriver( base ); // And intialise } #endif