X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Usermode%2FLibraries%2Fld-acess.so_src%2Fmain.c;h=85fbc74da90540f8f13825c33ac130b869f5944c;hb=270e5fe88b0666021a7a6393334db7feeb8245f8;hp=678dc9a6f448dd2455591642db6021acc89357d8;hpb=b98fbd4e9c71447d81fc9bd643fb174c76346e0f;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/ld-acess.so_src/main.c b/Usermode/Libraries/ld-acess.so_src/main.c index 678dc9a6..85fbc74d 100644 --- a/Usermode/Libraries/ld-acess.so_src/main.c +++ b/Usermode/Libraries/ld-acess.so_src/main.c @@ -12,6 +12,7 @@ // === Imports === extern void gLinkedBase; +extern tLoadedLib gLoadedLibraries[]; // === CODE === /** @@ -26,22 +27,25 @@ int SoMain(Uint base, int arg1) // - Assume that the file pointer will be less than 4096 if(base < 0x1000) { SysDebug("ld-acess - SoMain: Passed file pointer %i\n", base); - SysExit(); + _exit(-1); for(;;); } // Check if we are being called directly if(base == (Uint)&gLinkedBase) { SysDebug("ld-acess should not be directly called\n"); - SysExit(); + _exit(1); for(;;); } + + gLoadedLibraries[0].Base = (Uint)&gLinkedBase; + gLoadedLibraries[0].Name = "/Acess/Libs/libld-acess.so"; // Otherwise do relocations //ret = DoRelocate( base, envp, "Executable" ); ret = DoRelocate( base, NULL, "Executable" ); if( ret == 0 ) { SysDebug("ld-acess - SoMain: Relocate failed, base=0x%x\n", base); - SysExit(); + _exit(-1); for(;;); } @@ -67,7 +71,7 @@ int DoRelocate( Uint base, char **envp, char *Filename ) SysDebug("ld-acess - DoRelocate: Unkown file format '0x%x 0x%x 0x%x 0x%x'\n", *(Uint8*)(base), *(Uint8*)(base+1), *(Uint8*)(base+2), *(Uint8*)(base+3) ); SysDebug("ld-acess - DoRelocate: File '%s'\n", Filename); - SysExit(); + _exit(-1); for(;;); }