1 /* 2 * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 * 5 * Copyright 2002, Manuel J. Petit. All rights reserved. 6 * Distributed under the terms of the NewOS License. 7 */ 8 #ifndef RUNTIME_LOADER_H 9 #define RUNTIME_LOADER_H 10 11 12 #include <user_runtime.h> 13 #include <runtime_loader.h> 14 15 16 extern struct uspace_program_args *gProgramArgs; 17 extern struct rld_export gRuntimeLoader; 18 extern char *(*gGetEnv)(const char *name); 19 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 int runtime_loader(void *arg); 26 int open_executable(char *name, image_type type, const char *rpath); 27 status_t test_executable(const char *path, uid_t user, gid_t group, 28 char *starter); 29 30 void terminate_program(void); 31 image_id load_program(char const *path, void **entry); 32 status_t unload_library(image_id imageID, bool addOn); 33 image_id load_library(char const *path, uint32 flags, bool addOn); 34 status_t get_nth_symbol(image_id imageID, int32 num, char *nameBuffer, 35 int32 *_nameLength, int32 *_type, void **_location); 36 status_t get_symbol(image_id imageID, char const *symbolName, int32 symbolType, 37 void **_location); 38 status_t get_next_image_dependency(image_id id, uint32 *cookie, 39 const char **_name); 40 int resolve_symbol(image_t *rootImage, image_t *image, struct Elf32_Sym *sym, 41 addr_t *sym_addr); 42 43 44 status_t elf_verify_header(void *header, int32 length); 45 void rldelf_init(void); 46 void rldexport_init(void); 47 48 status_t heap_init(void); 49 50 // arch dependent prototypes 51 status_t arch_relocate_image(image_t *rootImage, image_t *image); 52 53 #ifdef __cplusplus 54 } 55 #endif 56 57 #endif /* RUNTIME_LOADER_H */ 58