X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fbin%2Felf.c;h=745c2c7ab141a575925050756b6036e6764b2662;hb=47e9dfd89189fc6b150bd6b20229cb047c7e0858;hp=dcfe35c68208a97523a4dba97587d5963105cefe;hpb=04b368645c34cc3853fc13f93e33ac7878be8479;p=tpg%2Facess2.git diff --git a/Kernel/bin/elf.c b/Kernel/bin/elf.c index dcfe35c6..745c2c7a 100644 --- a/Kernel/bin/elf.c +++ b/Kernel/bin/elf.c @@ -277,6 +277,7 @@ int Elf_Relocate(void *Base) Elf32_Dyn *dynamicTab = NULL; // Dynamic Table Pointer char *dynstrtab = NULL; // .dynamic String Table Elf32_Sym *dynsymtab = NULL; + int bFailed = 0; ENTER("pBase", Base); @@ -393,8 +394,7 @@ int Elf_Relocate(void *Base) { ptr = (void*)(iBaseDiff + rel[i].r_offset); if( !Elf_Int_DoRelocate(rel[i].r_info, ptr, *ptr, dynsymtab, (Uint)Base) ) { - LEAVE('x', 0); - return 0; + bFailed = 1; } } } @@ -406,8 +406,7 @@ int Elf_Relocate(void *Base) { ptr = (void*)(iBaseDiff + rela[i].r_offset); if( !Elf_Int_DoRelocate(rel[i].r_info, ptr, rela[i].r_addend, dynsymtab, (Uint)Base) ) { - LEAVE('x', 0); - return 0; + bFailed = 1; } } } @@ -423,8 +422,7 @@ int Elf_Relocate(void *Base) { ptr = (void*)(iBaseDiff + pltRel[i].r_offset); if( !Elf_Int_DoRelocate(pltRel[i].r_info, ptr, *ptr, dynsymtab, (Uint)Base) ) { - LEAVE('x', 0); - return 0; + bFailed = 1; } } } @@ -436,13 +434,17 @@ int Elf_Relocate(void *Base) { ptr = (void*)((Uint)Base + pltRela[i].r_offset); if( !Elf_Int_DoRelocate(pltRela[i].r_info, ptr, pltRela[i].r_addend, dynsymtab, (Uint)Base) ) { - LEAVE('x', 0); - return 0; + bFailed = 1; } } } } + if(bFailed) { + LEAVE('i', 0); + return 0; + } + LEAVE('x', hdr->entrypoint); return hdr->entrypoint; }