2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2008-02-17 19:38:07 +03:00
|
|
|
* Copyright 2003-2008, 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.
|
|
|
|
*/
|
2006-03-30 20:29:53 +04:00
|
|
|
#ifndef RUNTIME_LOADER_H
|
|
|
|
#define RUNTIME_LOADER_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
#include <user_runtime.h>
|
2006-01-06 06:48:11 +03:00
|
|
|
#include <runtime_loader.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2006-03-30 20:29:53 +04:00
|
|
|
|
2007-07-27 06:32:19 +04:00
|
|
|
extern struct user_space_program_args *gProgramArgs;
|
2006-05-09 03:50:09 +04:00
|
|
|
extern struct rld_export gRuntimeLoader;
|
|
|
|
extern char *(*gGetEnv)(const char *name);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2005-03-21 22:11:12 +03:00
|
|
|
int runtime_loader(void *arg);
|
2008-02-17 19:38:07 +03:00
|
|
|
int open_executable(char *name, image_type type, const char *rpath,
|
2008-05-18 03:25:17 +04:00
|
|
|
const char *programPath, const char *compatibilitySubDir);
|
2008-03-20 04:45:00 +03:00
|
|
|
status_t test_executable(const char *path, char *interpreter);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2006-01-06 06:48:11 +03:00
|
|
|
void terminate_program(void);
|
2003-01-12 19:51:15 +03:00
|
|
|
image_id load_program(char const *path, void **entry);
|
2008-11-09 01:40:56 +03:00
|
|
|
image_id load_library(char const *path, uint32 flags, bool addOn,
|
|
|
|
void** _handle);
|
|
|
|
status_t unload_library(void* handle, image_id imageID, bool addOn);
|
2007-06-01 22:09:32 +04:00
|
|
|
status_t get_nth_symbol(image_id imageID, int32 num, char *nameBuffer,
|
|
|
|
int32 *_nameLength, int32 *_type, void **_location);
|
2003-01-12 19:51:15 +03:00
|
|
|
status_t get_symbol(image_id imageID, char const *symbolName, int32 symbolType,
|
2009-02-28 21:50:40 +03:00
|
|
|
bool recursive, image_id *_inImage, void **_location);
|
2008-11-09 01:40:56 +03:00
|
|
|
status_t get_library_symbol(void* handle, void* caller, const char* symbolName,
|
|
|
|
void **_location);
|
2007-06-01 22:09:32 +04:00
|
|
|
status_t get_next_image_dependency(image_id id, uint32 *cookie,
|
|
|
|
const char **_name);
|
|
|
|
int resolve_symbol(image_t *rootImage, image_t *image, struct Elf32_Sym *sym,
|
|
|
|
addr_t *sym_addr);
|
2006-01-06 06:48:11 +03:00
|
|
|
|
2003-01-12 19:51:15 +03:00
|
|
|
|
2005-06-14 15:23:29 +04:00
|
|
|
status_t elf_verify_header(void *header, int32 length);
|
|
|
|
void rldelf_init(void);
|
|
|
|
void rldexport_init(void);
|
2008-09-18 12:04:29 +04:00
|
|
|
status_t elf_reinit_after_fork(void);
|
2003-01-12 19:51:15 +03:00
|
|
|
|
2006-10-11 20:02:43 +04:00
|
|
|
status_t heap_init(void);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2006-01-06 06:48:11 +03:00
|
|
|
// arch dependent prototypes
|
2007-06-01 22:09:32 +04:00
|
|
|
status_t arch_relocate_image(image_t *rootImage, image_t *image);
|
2006-01-06 06:48:11 +03:00
|
|
|
|
2006-05-09 03:50:09 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2005-06-14 15:23:29 +04:00
|
|
|
|
2006-03-30 20:29:53 +04:00
|
|
|
#endif /* RUNTIME_LOADER_H */
|