Moved export stuff to rldexport.c, rldexport_init() is now also called.

Cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2431 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2003-01-12 16:48:09 +00:00
parent 0119ceeb8e
commit f351df0829
2 changed files with 11 additions and 36 deletions
+10 -36
View File
@@ -3,55 +3,29 @@
** Distributed under the terms of the NewOS License. ** Distributed under the terms of the NewOS License.
*/ */
#include <string.h> #include <string.h>
#include <syscalls.h> #include <syscalls.h>
#include <user_runtime.h> #include <user_runtime.h>
#include "rld_priv.h" #include "rld_priv.h"
static struct rld_export_t exports=
{
/*
* Unix like stuff
*/
export_dl_open,
export_dl_close,
export_dl_sym,
/*
* BeOS like stuff
*/
export_load_addon,
export_unload_addon,
export_addon_symbol
};
int int
rldmain(void *arg) rldmain(void *_args)
{ {
int retval; struct uspace_program_args *args = (struct uspace_program_args *)_args;
unsigned long entry; void *entry = 0;
struct uspace_prog_args_t *uspa= (struct uspace_prog_args_t *)arg;
rldheap_init(); rldheap_init();
entry= 0; rldexport_init(args);
rldelf_init(args);
uspa->rld_export= &exports; load_program(args->program_path, &entry);
rldelf_init(uspa); if (entry == NULL)
load_program(uspa->prog_path, (void**)&entry);
if(entry) {
retval= ((int(*)(void*))(entry))(uspa);
} else {
return -1; return -1;
}
return retval; // call the program entry point (usually main())
return ((int (*)(void *))entry)(args);
} }
+1
View File
@@ -5,6 +5,7 @@
#include "rld_priv.h" #include "rld_priv.h"
int RLD_STARTUP(void *args) int RLD_STARTUP(void *args)
{ {
#if DEBUG_RLD #if DEBUG_RLD