xref: /haiku/src/system/runtime_loader/runtime_loader_private.h (revision 1acbe440b8dd798953bec31d18ee589aa3f71b73)
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, char *starter);
28 
29 void terminate_program(void);
30 image_id load_program(char const *path, void **entry);
31 status_t unload_library(image_id imageID, bool addOn);
32 image_id load_library(char const *path, uint32 flags, bool addOn);
33 status_t get_nth_symbol(image_id imageID, int32 num, char *nameBuffer, int32 *_nameLength,
34 	int32 *_type, void **_location);
35 status_t get_symbol(image_id imageID, char const *symbolName, int32 symbolType,
36 	void **_location);
37 status_t get_next_image_dependency(image_id id, uint32 *cookie, const char **_name);
38 int resolve_symbol(image_t *image, struct Elf32_Sym *sym, addr_t *sym_addr);
39 
40 
41 status_t elf_verify_header(void *header, int32 length);
42 void rldelf_init(void);
43 void rldexport_init(void);
44 
45 status_t heap_init(void);
46 
47 // arch dependent prototypes
48 status_t arch_relocate_image(image_t *image);
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif	/* RUNTIME_LOADER_H */
55