Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git] / Usermode / Libraries / ld-acess.so_src / main.c
index 40c603e..976ceec 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdint.h>\r
 #include <stddef.h>\r
 #include "common.h"\r
+#undef SoMain\r
 \r
 // === PROTOTYPES ===\r
 void   *DoRelocate(void *base, char **envp, const char *Filename);\r
@@ -14,6 +15,7 @@ void  *DoRelocate(void *base, char **envp, const char *Filename);
 extern char    gLinkedBase[];\r
 char   **gEnvP;\r
 extern int     memcmp(const void *m1, const void *m2, size_t size);\r
+extern void    CallQueuedEntrypoints(char **EnvP);\r
  \r
 // === CODE ===\r
 /**\r
@@ -41,7 +43,6 @@ void *SoMain(void *base, int argc, char **argv, char **envp)
        }\r
 \r
        // Otherwise do relocations\r
-       //ret = DoRelocate( base, envp, "Executable" );\r
        ret = DoRelocate( base, NULL, "Executable" );\r
        if( ret == 0 ) {\r
                SysDebug("ld-acess - SoMain: Relocate failed, base=0x%x\n", base);\r
@@ -49,7 +50,10 @@ void *SoMain(void *base, int argc, char **argv, char **envp)
                for(;;);\r
        }\r
 \r
-       SysDebug("ld-acess - SoMain: ret = %p", ret);   \r
+       // Call queued entry points (from libraries)\r
+       CallQueuedEntrypoints(envp);\r
+\r
+       SysDebug("ld-acess - SoMain: Program entry %p", ret);   \r
        return ret;\r
 }\r
 \r

UCC git Repository :: git.ucc.asn.au