X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Fld-acess.so_src%2Fmain.c;h=e379a70af18848c4327aef942c24c831ddfc9226;hb=91a13665236dfe9f0c053eb49d8ab60a6476f9ad;hp=ff715bb33502853568f04b76e7d694745098b011;hpb=032ec5adf8d4faeaa9293da50ad2e32c83dd1704;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 ff715bb3..e379a70a 100644 --- a/Usermode/Libraries/ld-acess.so_src/main.c +++ b/Usermode/Libraries/ld-acess.so_src/main.c @@ -12,7 +12,8 @@ void *DoRelocate(void *base, char **envp, const char *Filename); // === Imports === extern char gLinkedBase[]; -extern tLoadedLib gLoadedLibraries[]; +char **gEnvP; +extern int memcmp(const void *m1, const void *m2, size_t size); // === CODE === /** @@ -20,10 +21,12 @@ extern tLoadedLib gLoadedLibraries[]; \brief Library entry point \note This is the entrypoint for the library */ -void *SoMain(void *base) +void *SoMain(void *base, int argc, char **argv, char **envp) { void *ret; + gEnvP = envp; + // - Assume that the file pointer will be less than 4096 if((intptr_t)base < 0x1000) { SysDebug("ld-acess - SoMain: Passed file pointer %i\n", base); @@ -37,10 +40,6 @@ void *SoMain(void *base) for(;;); } - gLoadedLibraries[0].Base = &gLinkedBase; - // 'libld-acess.so' because that is what applications link against - gLoadedLibraries[0].Name = "/Acess/Libs/libld-acess.so"; - // Otherwise do relocations //ret = DoRelocate( base, envp, "Executable" ); ret = DoRelocate( base, NULL, "Executable" ); @@ -97,3 +96,8 @@ int CallUser(void *entry, void *sp) #endif for(;;); } + +void abort(void) +{ + _exit(-4); +}