2003-01-12 19:37:40 +03:00
|
|
|
/*
|
2006-03-30 20:29:53 +04:00
|
|
|
* Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de.
|
2005-03-14 03:53:59 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2002, Manuel J. Petit. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
|
|
|
|
2003-01-12 19:37:40 +03:00
|
|
|
|
2006-03-30 20:29:53 +04:00
|
|
|
#include "runtime_loader_private.h"
|
2003-01-12 19:37:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
// exported via the rld_export structure in user space program arguments
|
|
|
|
|
|
|
|
|
|
|
|
static image_id
|
|
|
|
export_load_add_on(char const *name, uint32 flags)
|
|
|
|
{
|
2005-03-12 03:00:04 +03:00
|
|
|
return load_library(name, flags, true);
|
2003-01-12 19:37:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static status_t
|
|
|
|
export_unload_add_on(image_id id)
|
|
|
|
{
|
2005-03-12 03:00:04 +03:00
|
|
|
return unload_library(id, true);
|
2003-01-12 19:37:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static status_t
|
|
|
|
export_get_image_symbol(image_id id, char const *symbolName, int32 symbolType, void **_location)
|
|
|
|
{
|
|
|
|
return get_symbol(id, symbolName, symbolType, _location);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static status_t
|
|
|
|
export_get_nth_image_symbol(image_id id, int32 num, char *nameBuffer, int32 *_nameLength,
|
|
|
|
int32 *_symbolType, void **_location)
|
|
|
|
{
|
|
|
|
return get_nth_symbol(id, num, nameBuffer, _nameLength, _symbolType, _location);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-14 15:23:29 +04:00
|
|
|
static status_t
|
|
|
|
export_test_executable(const char *path, uid_t user, gid_t group, char *starter)
|
|
|
|
{
|
|
|
|
return test_executable(path, user, group, starter);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-10-06 15:40:20 +04:00
|
|
|
static status_t
|
|
|
|
export_get_next_image_dependency(image_id id, uint32 *cookie, const char **_name)
|
|
|
|
{
|
|
|
|
return get_next_image_dependency(id, cookie, _name);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-01-06 06:48:11 +03:00
|
|
|
struct rld_export gRuntimeLoader = {
|
|
|
|
// dynamic loading support API
|
|
|
|
export_load_add_on,
|
|
|
|
export_unload_add_on,
|
|
|
|
export_get_image_symbol,
|
|
|
|
export_get_nth_image_symbol,
|
2006-10-06 15:40:20 +04:00
|
|
|
export_test_executable,
|
|
|
|
export_get_next_image_dependency
|
2006-01-06 06:48:11 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2005-06-14 15:23:29 +04:00
|
|
|
rldexport_init(void)
|
2003-01-12 19:37:40 +03:00
|
|
|
{
|
2006-01-06 06:48:11 +03:00
|
|
|
gRuntimeLoader.program_args = gProgramArgs;
|
2003-01-12 19:37:40 +03:00
|
|
|
}
|